method getTotal documentation in bbn\Appui\Grid
function($force = false)
{
if ( $this->num && !$force ){
return $this->num;
}
/*
if ( !$force && ($cache = $this->getCache()) ){
$this->count_time = $cache['time'];
$this->num = $cache['num'];
return $this->num;
}
*/
if ( $this->count ){
$this->chrono->start();
if ( is_string($this->count) ){
$this->num = $this->db->getOne(
$this->count.PHP_EOL.
$this->db->getWhere($this->cfg).
$this->db->getGroupBy($this->cfg),
\array_map(function($v){
if (Str::isUid($v)) {
$v = hex2bin($v);
}
return $v;
}, $this->db->getQueryValues($this->cfg))
);
}
else if ( is_array($this->count) ){
$cfg = $this->count;
$cfg['where'] = $this->cfg['where'];
$this->num = $this->db->selectOne($cfg);
}
elseif (is_int($this->count)) {
$this->num = $this->count;
}
$this->count_time = $this->chrono->measure();
$this->chrono->stop();
$this->setCache([
'num' => $this->num,
'time' => $this->count_time
]);
return $this->num ?: 0;
}
else if ( $this->count_cfg ){
//X::log($this->count_cfg, 'mirko');
//die(X::dump($this->count_cfg));
$this->chrono->start();
$this->num = $this->db->selectOne($this->count_cfg);
$this->count_time = $this->chrono->measure();
$this->chrono->stop();
$this->setCache([
'num' => $this->num,
'time' => $this->count_time
]);
return $this->num ?: 0;
}
return null;
}
BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2023
BBN Solutions