本文整理汇总了PHP中Nette\Database\Table\Selection::count方法的典型用法代码示例。如果您正苦于以下问题:PHP Selection::count方法的具体用法?PHP Selection::count怎么用?PHP Selection::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Database\Table\Selection
的用法示例。
在下文中一共展示了Selection::count方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCount
/**
* @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;
}
示例2: getCount
/**
* 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));
}
示例3: __construct
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('*');
}
示例4: actionDefault
/** 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");
}
}
}
示例5: count
/** @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;
}
示例6: count
public function count($column = NULL)
{
$return = parent::count($column);
return isset($return) ? $return : 0;
}
示例7: getCount
/**
* @return int
*/
public function getCount()
{
return (int) $this->selection->count('*');
}
示例8: __construct
/**
* @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('*');
}
示例9: _count
/**
* Item count
* @return int
*/
protected function _count()
{
return $this->selection->count('*');
}
示例10: count
/**
* Counts number of rows
* @param string|null $column
* @return int
*/
public function count($column = null)
{
return $this->selection->count($column);
}
示例11: count
function count($column = '')
{
$return = parent::count($column);
return isset($return) ? $return : 0;
}
示例12: count
/**
* Count columns
* @param string $countBy
* @return int
*/
public function count($countBy = '*')
{
return $this->table->count($countBy);
}
示例13:
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
示例14: getCount
/**
* Get count of data
* @return int
*/
public function getCount()
{
return $this->data_source->count($this->primary_key);
}
示例15: addPaginator
/**
* @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;
}