|
Ubiquity 2.5.2
php rapid development framework
|
A repository for managing CRUD operations on a model. More...
Inheritance diagram for AbstractRepository:Public Member Functions | |
| all (string $condition='', $included=false, array $parameters=[], bool $useCache=false) | |
| Load all instances. | |
| orderBy (string $field, string $order='ASC', string $condition='', $included=false, array $parameters=[], bool $useCache=false) | |
| Load all instances with order. | |
| byId ($keyValues, $included=true, bool $useCache=false) | |
| Load one instance by id. | |
| one (string $condition='', $included=true, array $parameters=[], bool $useCache=false) | |
| Load one instance. | |
| insert (object $instance, bool $insertMany=false) | |
| Insert a new instance $instance into the database. | |
| update (object $instance, bool $insertMany=false) | |
| Update an instance $instance in the database. | |
| save (object $instance, bool $insertMany=false) | |
| Save (insert or update) an instance $instance in the database. | |
| remove (object $instance) | |
| Remove an instance $instance from the database. | |
| count (string $condition='',?array $parameters=null) | |
| Returns the number of instances. | |
Protected Member Functions | |
| getModel () | |
A repository for managing CRUD operations on a model.
Ubiquity\orm\repositories$AbstractRepository This class is part of Ubiquity
Definition at line 18 of file AbstractRepository.php.
| all | ( | string | $condition = '', |
$included = false, |
|||
| array | $parameters = [ ], |
||
| bool | $useCache = false |
||
| ) |
Load all instances.
| string | $condition | |
| array | boolean | $included | |
| array | $parameters | |
| bool | $useCache |
Definition at line 31 of file AbstractRepository.php.
| byId | ( | $keyValues, | |
$included = true, |
|||
| bool | $useCache = false |
||
| ) |
Load one instance by id.
| $keyValues | ||
| bool | array | $included | |
| bool | $useCache |
Definition at line 58 of file AbstractRepository.php.
| count | ( | string | $condition = '', |
| ?array | $parameters = null |
||
| ) |
Returns the number of instances.
| string | $condition | |
| array | $parameters |
Definition at line 127 of file AbstractRepository.php.
|
abstractprotected |
Reimplemented in Repository.
| insert | ( | object | $instance, |
| bool | $insertMany = false |
||
| ) |
Insert a new instance $instance into the database.
| object | $instance | |
| bool | $insertMany |
Exception
Definition at line 84 of file AbstractRepository.php.
| one | ( | string | $condition = '', |
$included = true, |
|||
| array | $parameters = [ ], |
||
| bool | $useCache = false |
||
| ) |
Load one instance.
| string | $condition | |
| bool | array | $included | |
| array | $parameters | |
| bool | $useCache |
Ubiquity\exceptions\DAOException
Definition at line 72 of file AbstractRepository.php.
| orderBy | ( | string | $field, |
| string | $order = 'ASC', |
||
| string | $condition = '', |
||
$included = false, |
|||
| array | $parameters = [ ], |
||
| bool | $useCache = false |
||
| ) |
Load all instances with order.
| string | $field | The field to order by |
| string | $order | The order (ASC, DESC) |
| string | $condition | The condition |
| bool | array | $included | The relations to include |
| array | $parameters | The parameters for the condition |
| bool | $useCache | If true, use the cache |
Definition at line 46 of file AbstractRepository.php.
| remove | ( | object | $instance | ) |
Remove an instance $instance from the database.
| object | $instance |
Definition at line 116 of file AbstractRepository.php.
| save | ( | object | $instance, |
| bool | $insertMany = false |
||
| ) |
Save (insert or update) an instance $instance in the database.
| object | $instance | |
| bool | $insertMany |
Definition at line 106 of file AbstractRepository.php.
| update | ( | object | $instance, |
| bool | $insertMany = false |
||
| ) |
Update an instance $instance in the database.
| object | $instance | |
| bool | $insertMany |
Definition at line 95 of file AbstractRepository.php.