/** * @return int */ public function getCount() { if ($this->count === NULL) { $column = !$this->source->getPrimary(FALSE) ? '*' : $this->source->getPrimary(); $this->count = $this->source->count($column); } return $this->count; }
/** * Get count of data * @return int */ public function getCount() { try { $primary = $this->data_source->getPrimary(); } catch (\LogicException $e) { return $this->data_source->count('*'); } return $this->data_source->count($this->data_source->getName() . '.' . (is_array($primary) ? reset($primary) : $primary)); }
public function __construct($tableName, $primaryKey, Nette\Database\Table\Selection $selection, Nette\Database\Context $context, $columnMapping = []) { $this->context = $context; $this->netteTable = $selection; $this->columnMapping = $columnMapping; parent::__construct($tableName, $primaryKey); $this->totalCount = $selection->count('*'); }
/** Akcia pre nacitanie aktualnych oznamov */ public function actionDefault() { //Z DB zisti ako budu oznamy usporiadane if (($pomocna = $this->udaje->getKluc("oznam_usporiadanie")) !== FALSE) { $oznamy_usporiadanie = (bool) $pomocna->text; } else { $oznamy_usporiadanie = FALSE; } $this->aktualne = $this->oznam->aktualne($oznamy_usporiadanie); //Ak nie su oznamy najdi 1. clanok cez udaje a ak je tak presmeruj na neho if ($this->aktualne->count() == 0) { if (($id = $this->udaje->getUdajInt('oznam_prva_stranka')) > 0) { $this->flashRedirect(['Clanky:default', $id], $this->trLang('ziaden_aktualny'), 'info'); } else { $this->setView("prazdne"); } } }
/** @return int */ public function count() { if ($this->data !== NULL) { return count($this->data); } if ($this->count === NULL) { $this->count = $this->selection->count('*'); } return $this->count; }
public function count($column = NULL) { $return = parent::count($column); return isset($return) ? $return : 0; }
/** * @return int */ public function getCount() { return (int) $this->selection->count('*'); }
/** * @param Selection $nette_table * @param Context|NULL $context */ public function __construct(Selection $nette_table, Context $context = NULL) { $this->context = $context; $this->nette_table = $nette_table; $this->total_count = $nette_table->count('*'); }
/** * Item count * @return int */ protected function _count() { return $this->selection->count('*'); }
/** * Counts number of rows * @param string|null $column * @return int */ public function count($column = null) { return $this->selection->count($column); }
function count($column = '') { $return = parent::count($column); return isset($return) ? $return : 0; }
/** * Count columns * @param string $countBy * @return int */ public function count($countBy = '*') { return $this->table->count($countBy); }
as$row){$aggregation[$row[$this->column]]=$row;}}if(isset($aggregation[$this->active])){foreach($aggregation[$this->active]as$val){return$val;}}}function count($column=''){$return=parent::count($column);return isset($return)?$return:0;}function
/** * Get count of data * @return int */ public function getCount() { return $this->data_source->count($this->primary_key); }
/** * @param Selection $out * @param Paginator $paginator * @return Selection */ protected function addPaginator($out, Paginator $paginator) { $paginator->setItemsPerPage($this->itemsPerPage); $paginator->setItemCount($out->count()); $out->limit($paginator->itemsPerPage, $paginator->offset); return $out; }