Methods summary
public
|
#
save( PropertiesMapInterface $object )
Saves
$object
in the table.
If the object does not exist, it is created, else, just updated
Saves
$object
in the table.
If the object does not exist, it is created, else, just updated
Parameters
- $object
- the object to save
|
public
|
#
update( array $fields, string $where = DAO::WHERE_ALL, array $parameters = array() )
Update all fields in the table to the given value if row match the where clause.
Update all fields in the table to the given value if row match the where clause.
Parameters
- $fields
- keys are the fields names to update, values, their new value
- $where
- the part of the query that came just after the from
- $parameters
the query vars to inject into the
$where
|
public
|
#
delete( PropertiesMapInterface $object )
Deletes
$object
from the table.
If the object does not exist, nothing is done
Deletes
$object
from the table.
If the object does not exist, nothing is done
Parameters
- $object
- the object to delete
|
public
|
#
delete_all( string $where = DAO::WHERE_ALL, array $parameters = array() )
Deletes all object matching the where clause from the table.
Deletes all object matching the where clause from the table.
Parameters
- $where
- the part of the query that came just after the from
- $parameters
the query vars to inject into the
$where
|
public
|
#
count( string $where = DAO::WHERE_ALL, array $parameters = array() )
Count the number of object in the table matching the
$where
clause
Count the number of object in the table matching the
$where
clause
Parameters
- $where
- the part of the query that came just after the from
- $parameters
the query vars to inject into the
$where
|
public
PropertiesMapInterface
|
#
find_by_id( mixed $id )
retrieves the object with the
$id
primary identifier
retrieves the object with the
$id
primary identifier
Parameters
- $id
- the object primary identifier (shoudl always be an integer)
Returns
Throws
|
public
QueryResultMapper
|
#
find_all( integer $limit = 100, integer $offset = 0, string[mixed][] $order_by = array() )
retrieves the
$limit
first objects from the
$offset
one.
If
$order_by
is specified, objects will be sorted in the
$way
way
retrieves the
$limit
first objects from the
$offset
one.
If
$order_by
is specified, objects will be sorted in the
$way
way
Parameters
- $limit
- the maximum number of objets to retrieve
- $offset
- the offset from which retrieves objects
- $order_by
the column(s) on which sort will be done.
This parameter is an array with nested associative subarrays for each column:
array(array('column' => $column1, 'way' => $way1), ...)
$column1
must be a column name or an alias and
$way
could be
ascending (
SQLQuerier::ORDER_BY_ASC
) or descending (
SQLQuerier::ORDER_BY_DESC
)
Returns
QueryResultMapper the objects list
|
public
QueryResultMapper
|
#
find_by_criteria( string $criteria, string[string] $parameters = array() )
retrieves all the objects in the table matching the
$criteria
retrieves all the objects in the table matching the
$criteria
Parameters
- $criteria
- the part of the query that came just after the from
- $parameters
the query vars to inject into the
$criteria
Returns
QueryResultMapper the objects list
|