Class ModelCollection
-
ICanBoogie\ActiveRecord\ModelCollection
implements
ArrayAccess
uses
ICanBoogie\Accessor\AccessorTrait (not available)
Methods summary
protected
get_instances( void )
protected
get_definitions( void )
protected
get_connections( void )
public
offsetExists( string $id
)
: boolean
Checks if a model is defined.
Checks if a model is defined.
Parameters
Returns
boolean
Implementation of
ArrayAccess::offsetExists()
public
offsetSet( string $id
, array $definition
)
Sets the definition of a model.
Sets the definition of a model.
The Model::ID and Model::NAME are set to the provided id if they are not
defined.
Parameters
$id
- Model identifier.
$definition
- Model definition.
Throws
Implementation of
ArrayAccess::offsetSet()
public
offsetUnset( string $id
)
Unset the definition of a model.
Unset the definition of a model.
Parameters
Throws
Implementation of
ArrayAccess::offsetUnset()
protected
resolve_model_attributes( array $attributes
)
: array
Resolves model attributes.
protected
instantiate_model( array $attributes
)
: ICanBoogie\ActiveRecord\Model
Instantiate a model with the specified attributes.
Instantiate a model with the specified attributes.
Parameters
Returns
public
is_installed( void )
: array
Check if models are installed.
Check if models are installed.
Returns
array
An array of key/value pair where key is a model identifier and
value true
if the model is installed, false
otherwise.
Properties summary
protected
$definitions
: array
[]
Magic properties
public read-only
$definitions
: array