An abstraction to retrieve data form a database.
This version of WebLab_Table provides support for PHP 5.2.6 and higher.
| author | Jorgen Evens |
|---|---|
| package | WebLab |
countAll() : int
intThe amount of records found.create(mixed $object)
The id of the new record will be set in $object
mixedThe object to insert as a record.
createTable() : \WebLab_Data_Table
\WebLab_Data_TableAn instance of the abstraction layer Table class.delete(mixed $object)
If soft-delete is used it will only update the deleted and online field.
mixedThe object to delete from the table.
find($key) : mixed
mixedThe record as an object.findAll(int $count, int $start, int $result_count) : mixed
intThe amount of records to retrieve.
intThe offset to start retrieving from.
int&$result_count If different from false, will be set to the total amount of records in the table.
mixedAn array of objects representing a record.findBy(mixed $field, mixed $value, int $result_count) : mixed
mixedThe fieldname or a list of filters to use as $column => $value pairs.
mixedIf field is a fieldname, the value it should match.
int&$result_count If different from false, will be set to the amount of records.
mixedAn array of objects representing a record.quitTransaction(boolean $commit)
booleanShould changes be committed or discarded.
save(mixed $object)
mixedThe object to insert as a record.
startTransaction()
table() : string
update(mixed $object)
mixedThe new values for this record, including the unaltered primary key.
_hasField($field) : boolean
The name of the column to test for.
booleanTrue if field is present.$_database : string
| see | \WebLab_Config |
|---|---|
| see | \WebLab_Database |
$_fields : mixed
$_instance : \WebLab_Table
$_primary_keys : mixed
If there is a auto_increment field, it should be the first in this list. find( $id ) calls will be matched against the first field in this array.
$_table : string