NullDataMapper
class NullDataMapper extends DataMapper (View source)
The NullDataMapper class.
Methods
NullDataMapper constructor.
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.
Same as update(), just update one row.
Using one data to update multiple rows, filter by where conditions.
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 25
__construct()
NullDataMapper constructor.
at line line 51
mixed|DataSet
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 72
mixed|DataSet
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 96
mixed|Data
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 123
mixed
findColumn(string $column, mixed $conditions = array(), mixed $order = null, integer $start = null, integer $limit = null)
Find column as an array.
at line line 137
mixed|DataSet
create(mixed $dataset)
Create records by data set.
at line line 152
mixed|Data
createOne(mixed $data)
Create one record by data object.
at line line 169
mixed|DataSet
update(mixed $dataset, array $condFields = null, bool $updateNulls = false)
Update records by data set. Every data depend on this table's primary key to update itself.
at line line 186
mixed|Data
updateOne(mixed $data, array $condFields = null, bool $updateNulls = false)
Same as update(), just update one row.
at line line 209
boolean
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 226
mixed|DataSet
flush(mixed $dataset, mixed $conditions = array())
Flush records, will delete all by conditions then recreate new.
at line line 244
mixed|DataSet
save(mixed $dataset, array $condFields = null, bool $updateNulls = false)
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 261
mixed|Data
saveOne(mixed $data, array $condFields = null, bool $updateNulls = false)
Save only one row.
at line line 293
boolean
delete(mixed $conditions)
Delete records by where conditions.