Repository
abstract class Repository (View source)
Provides functionality to perform basic database operations on models.
Properties
protected Connection | $connection |
Methods
array
Model|null
Model|null
void
fillRelationships(array $models, array $relationships)
Fills the given relationships for the given models.
Details
at line 23
__construct(Connection $connection)
Repository constructor.
at line 36
protected array
find(Schema $schema, array $conditions, array $order = [], int $limit = null)
Returns a list of models from the database based on given conditions.
at line 57
protected Model|null
findOne(Schema $schema, array $conditions, array $order = [])
Returns a single model based on the given conditions.
at line 76
protected Model|null
findByPrimaryKey(Schema $schema, mixed $values)
Finds a single model based on the primary key.
at line 128
protected void
save(Model $model)
Inserts or updates the given model based on its state.
at line 177
protected void
refresh(Model $model)
Updates the field values for the model from the database.
at line 234
protected void
fillRelationships(array $models, array $relationships)
Fills the given relationships for the given models.