Detailed Description
A database table class. Provides functionality for simple operations against a database table. This class can either be extended, or instantiated dynamically via TableFactory.
- See also:
- TableFactory
Member Function Documentation
Deletes table records that match the supplied database condition.
- Parameters:
-
\lib360\db\condition\ICondition | $condition | optional condition to apply to the query |
array | $values | optional associative array of values for aliases in the condition object |
- Returns:
- integer number of rows deleted
Implements ITable.
Inserts a database record.
- Parameters:
-
array | $fields | associative array of fields for insert (table field) => (update value) |
- Returns:
- integer number of rows inserted
Implements ITable.
Gets table records that match the supplied database condition.
- Parameters:
-
\lib360\db\condition\ICondition | $condition | optional condition to apply to the query |
array | $values | optional associative array of values for aliases in the condition object |
array | $fields | optional array of fields to return, can be associative for (table field) => (select as field) or a simple array of table field names, will override default $fields property |
- Returns:
- a database recordlist object,
- See also:
- TODO add order/group by support
Implements ITable.
selectRecords |
( |
array |
$conditions = array() , |
|
|
array |
$fields = NULL |
|
) |
| |
Gets table records by field criteria.
- Parameters:
-
array | $conditions | optional associative array of column names and their values to use as conditions, values will explicitly be cast as strings |
array | $fields | optional array of fields to return, can be associative for (table field) => (select as field) or a simple array of table field names, will override default $fields property |
- Returns:
- IRecordList object containing matched rows
- See also:
- RecordList
Implements ITable.
Updates database record(s) based on supplied criteria and values.
- Parameters:
-
array | $fields | associative array of fields to update (table field) => (update value) |
\lib360\db\condition\ICondition | $condition | optional object to apply to the update |
array | $values | optional associative array of values for aliases in the condition object |
- Returns:
- integer number of rows updated
Implements ITable.
Field Documentation
Optional view default fields array. Extending classes may optionally (but recommended) define the list of fields that will be returned by default. This default can be overriden in the select method.
Table keys array. Extending classes will need to define a simple array listing table's primary keys as element values. NOTE currently not used NOTE this will be useful when implementing selectRecord/updateRecord methods
The documentation for this class was generated from the following file: