24 $this->_controller = $controller;
35 public function trans($column,$key,$value,$params = null){
45 public function exists($key,$value,$params = null){
64 public function search($search,
$order = null,$params = null,$offset = 0,$limit = null){
65 $records = $this->
_search($search,
$order,$params,$offset,$limit);
66 if($this->format) array_walk($records,$this->format);
70 protected function _totals($search,$totals,$params){
81 public function totals($search,$totals,$params = null){
82 $totals = $this->
_totals($search,$totals,$params);
83 if($this->format) call_user_func_array($this->format,[&$totals,
true]);
87 protected function _group($search,$group,$column,$total,$limit,$params){
100 public function group($search,$group,$column,$total,$limit = null,$params = null){
101 $totals = $this->
_group($search,$group,$column,$total,$limit,$params);
102 if($this->format)
foreach($totals as $key => $value){
103 $value = [$column => [$total => $value]];
104 call_user_func_array($this->format,[&$value,
true]);
105 $totals[$key] = $value[$column][$total];
const SEARCH_EXACT
Search for values identical to the reference value (this may also be an array with.
totals($search, $totals, $params=null)
Return the totals for selected columns.
trans($column, $key, $value, $params=null)
Translates a value using the dataset.
exists($key, $value, $params=null)
Check if a record exists in the dataset.
configure($config)
Configure the object.
_group($search, $group, $column, $total, $limit, $params)
_totals($search, $totals, $params)
const SEARCH_LIKE
Search for values that match reference value with wildcard (? = 1 char, * = multiple chars)...
_search($search, $order, $params, $offset, $limit)
const SEARCH_TO
Search for values smaller than the reference value.
const SEARCH_DATE
Search for a single date (24 hours).
$order
Basic/default order (same format as search function).
const SEARCH_FROM
Search for values larger than the reference value.
search($search, $order=null, $params=null, $offset=0, $limit=null)
Search for records in the dataset.
group($search, $group, $column, $total, $limit=null, $params=null)
Return the grouped totals for a column.
__construct($controller, $config)
const SEARCH_MULTI
Pseudo type to allow for multiple values.
$format
Format function to apply to each record (called with a single record by reference, and true as a.