Class ModelCollection
Model collection.
Extends the ActiveRecord model collection with the models defined by the modules.
-
ICanBoogie\ActiveRecord\Models
-
┗
ICanBoogie\Module\ModelCollection
Methods summary
public
__construct( ICanBoogie\ActiveRecord\Connections $connections
, ICanBoogie\Module\ModuleCollection
$modules
, array $definitions
= [] )
Parameters
$connections
- Connections manager.
$modules
- ModuleCollection manager.
$definitions
- Model definitions.
public
offsetExists( string $id
)
: boolean
Checks if a model exists by first checking if the module it belongs to is enabled and that
it actually defines the model.
Checks if a model exists by first checking if the module it belongs to is enabled and that
it actually defines the model.
Parameters
Returns
boolean
public
offsetGet( string $id
)
: ICanBoogie\ActiveRecord\Model
Gets the specified model of the specified module.
Gets the specified model of the specified module.
The pattern used to request a model is <module_id>[/<model_id>]
where <module_id>
is
the identifier of the module and <model_id>
is the identifier of the module's model. The
<model_id>
part is optional and defaults to primary
.
Parameters
$id
- Identifier of the model.
Returns
ICanBoogie\ActiveRecord\Model
Properties summary