Class||Interface DAO
Constants
FIND_ALL
FIND_ALL = 0
Tags
None found |
WHERE_ALL
WHERE_ALL = 'WHERE 1'
Tags
None found |
Methods
save()
save(\PropertiesMapInterface $object)
Saves <code>$object</code> in the table.
If the object does not exist, it is created, else, just updated
Parameters
\PropertiesMapInterface | $object | the object to save |
- Inherited from \DAO
Tags
None found |
update()
update(\mixed[string] $fields, string $where = \DAO::WHERE_ALL, \string[string] $parameters = array())
Update all fields in the table to the given value if row match the where clause.
Parameters
\mixed[string] | $fields | keys are the fields names to update, values, their new value |
string | $where | the part of the query that came just after the from |
\string[string] | $parameters | the query vars to inject into the |
- Inherited from \DAO
Tags
None found |
delete()
delete(\PropertiesMapInterface $object)
Deletes <code>$object</code> from the table.
If the object does not exist, nothing is done
Parameters
\PropertiesMapInterface | $object | the object to delete |
- Inherited from \DAO
Tags
None found |
delete_all()
delete_all(string $where = \DAO::WHERE_ALL, \string[string] $parameters = array())
Deletes all object matching the where clause from the table.
Parameters
string | $where | the part of the query that came just after the from |
\string[string] | $parameters | the query vars to inject into the |
- Inherited from \DAO
Tags
None found |
count()
count(string $where = \DAO::WHERE_ALL, \string[string] $parameters = array())
Count the number of object in the table matching the <code>$where</code> clause
Parameters
string | $where | the part of the query that came just after the from |
\string[string] | $parameters | the query vars to inject into the |
- Inherited from \DAO
Tags
None found |
find_by_id()
find_by_id(mixed $id) : \PropertiesMapInterface
retrieves the object with the <code>$id</code> primary identifier
Parameters
mixed | $id | the object primary identifier (shoudl always be an integer) |
Throws
- \ObjectNotFoundException
if no objects with this id are found in the table
Returns
the objet retrieved from the table
- Inherited from \DAO
Tags
None found |
find_all()
find_all(integer $limit = 100, integer $offset, array<mixed,\string[mixed]> $order_by = array()) : \QueryResultMapper
retrieves the <code>$limit</code> first objects from the <code>$offset</code> one.
If $order_by
is specified, objects will be sorted in the $way
way
Parameters
integer | $limit | the maximum number of objets to retrieve |
integer | $offset | the offset from which retrieves objects |
array<mixed,\string[mixed]> | $order_by | the column(s) on which sort will be done.
This parameter is an array with nested associative subarrays for each column:
|
Returns
the objects list
- Inherited from \DAO
Tags
None found |
find_by_criteria()
find_by_criteria(string $criteria, \string[string] $parameters = array()) : \QueryResultMapper
retrieves all the objects in the table matching the <code>$criteria</code>
Parameters
string | $criteria | the part of the query that came just after the from |
\string[string] | $parameters | the query vars to inject into the |
Returns
the objects list
- Inherited from \DAO
Tags
None found |