$db
$db : \Anax\Database\DatabaseQueryBuilder
An implementation of the Active Record pattern to be used as base class for database driven models.
$db : \Anax\Database\DatabaseQueryBuilder
setDb(\Anax\Database\DatabaseQueryBuilder $db) : void
Set the database object to use for accessing storage.
| \Anax\Database\DatabaseQueryBuilder | $db | as database access object. |
findWhere(string $where, mixed $value) : \Anax\Database\this
Find and return first object found by search criteria and use its data to populate this instance.
The search criteria $where of can be set up like this:
id = ?
id1 = ? and id2 = ?
The $value can be a single value or an array of values.
| string | $where | to use in where statement. |
| mixed | $value | to use in where statement. |
findAllWhere(string $where, mixed $value) : array
Find and return all matching the search criteria.
The search criteria $where of can be set up like this:
id = ?
id IN [?, ?]
The $value can be a single value or an array of values.
| string | $where | to use in where statement. |
| mixed | $value | to use in where statement. |
of object of this class
saveWhere(string $where, mixed $value) : void
Save/update current object/row using a custom where-statement.
The criteria $where of can be set up like this:
id = ?
id1 = ? AND id2 = ?
The $value can be a single value or an array of values.
| string | $where | to use in where statement. |
| mixed | $value | to use in where statement. |
deleteWhere(string $where, mixed $value) : void
Delete row using a custom where-statement and leave value of `$tableIdColumn` as it is.
The criteria $where of can be set up like this:
id = ?
id1 = ? AND id2 = ?
id IN (?, ?)
The $value can be a single value or an array of values.
| string | $where | to use in where statement. |
| mixed | $value | to use in where statement. |
updateWhere(string $where, mixed $value) : void
Update row using a custom where-statement.
The criteria $where of can be set up like this:
id = ?
id1 = ? AND id2 = ?
id IN (?, ?)
The $value can be a single value or an array of values.
| string | $where | to use in where statement. |
| mixed | $value | to use in where statement. |