DataMapperInterface
interface DataMapperInterface (View source)
DataMapper Interface
Methods
Find records and return data set.
Find records without where conditions and return data set.
Find one record and return a data.
Find column as an array.
Create records by data set.
Create one record by data object.
Update records by data set. Every data depend on this table's primary key to update itself.
Using one data to update multiple rows, filter by where conditions.
Same as update(), just update one row.
Flush records, will delete all by conditions then recreate new.
Save will auto detect is conditions matched in data or not.
Save only one row.
Delete records by where conditions.
Details
at line line 37
mixed
find(mixed $conditions = array(), mixed $order = null, integer $start = null, integer $limit = null)
Find records and return data set.
Example:
- $mapper->find(array('id' => 5), 'date', 20, 10);
- $mapper->find(null, 'id', 0, 1);
at line line 53
mixed
findAll(mixed $order = null, integer $start = null, integer $limit = null)
Find records without where conditions and return data set.
Same as $mapper->find(null, 'id', $start, $limit);
at line line 72
mixed
findOne(mixed $conditions = array(), mixed $order = null)
Find one record and return a data.
Same as $mapper->find($conditions, 'id', 0, 1);
at line line 94
mixed
findColumn(string $column, mixed $conditions = array(), mixed $order = null, integer $start = null, integer $limit = null)
Find column as an array.
at line line 103
mixed
create(mixed $dataset)
Create records by data set.
at line line 112
mixed
createOne(mixed $data)
Create one record by data object.
at line line 123
mixed
update(mixed $dataset, array $condFields = null)
Update records by data set. Every data depend on this table's primary key to update itself.
at line line 141
mixed
updateBatch(mixed $data, mixed $conditions = array())
Using one data to update multiple rows, filter by where conditions.
Example:
$mapper->updateAll(new Data(array('published' => 0)), array('date' => '2014-03-02'))
Means we make every records which date is 2014-03-02 unpublished.
at line line 152
mixed
updateOne(mixed $data, array $condFields = null)
Same as update(), just update one row.
at line line 166
mixed
flush(mixed $dataset, mixed $conditions = array())
Flush records, will delete all by conditions then recreate new.
at line line 178
mixed
save(mixed $dataset, array $condFields = null)
Save will auto detect is conditions matched in data or not.
If matched, using update, otherwise we will create it as new record.
at line line 189
mixed
saveOne(mixed $data, array $condFields = null)
Save only one row.
at line line 202
boolean
delete(mixed $conditions)
Delete records by where conditions.