当前位置: 首页>>代码示例>>PHP>>正文


PHP Selection::count方法代码示例

本文整理汇总了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;
 }
开发者ID:WebChemistry,项目名称:filter,代码行数:11,代码来源:NetteDataSource.php

示例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));
 }
开发者ID:ublaboo,项目名称:datagrid,代码行数:13,代码来源:NetteDatabaseTableDataSource.php

示例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('*');
 }
开发者ID:mesour,项目名称:sources,代码行数:8,代码来源:NetteDbTableSource.php

示例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");
         }
     }
 }
开发者ID:petak23,项目名称:echo-msz,代码行数:19,代码来源:OznamPresenter.php

示例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;
 }
开发者ID:uestla,项目名称:easyblog,代码行数:11,代码来源:EntityCollection.php

示例6: count

 public function count($column = NULL)
 {
     $return = parent::count($column);
     return isset($return) ? $return : 0;
 }
开发者ID:BroukPytlik,项目名称:agility,代码行数:5,代码来源:GroupedSelection.php

示例7: getCount

 /**
  * @return int
  */
 public function getCount()
 {
     return (int) $this->selection->count('*');
 }
开发者ID:cujan,项目名称:vcelyweb,代码行数:7,代码来源:NetteDatabase.php

示例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('*');
 }
开发者ID:adusak,项目名称:DataGrid,代码行数:10,代码来源:NetteDbDataSource.php

示例9: _count

 /**
  * Item count
  * @return int
  */
 protected function _count()
 {
     return $this->selection->count('*');
 }
开发者ID:natrim,项目名称:gridito,代码行数:8,代码来源:NetteModel.php

示例10: count

 /**
  * Counts number of rows
  * @param string|null $column
  * @return int
  */
 public function count($column = null)
 {
     return $this->selection->count($column);
 }
开发者ID:jkrecek,项目名称:nette-database-model,代码行数:9,代码来源:StoredCollection.php

示例11: count

 function count($column = '')
 {
     $return = parent::count($column);
     return isset($return) ? $return : 0;
 }
开发者ID:Vrtak-CZ,项目名称:NJLogParser,代码行数:5,代码来源:nette.min.php

示例12: count

 /**
  * Count columns
  * @param string $countBy
  * @return int
  */
 public function count($countBy = '*')
 {
     return $this->table->count($countBy);
 }
开发者ID:drahak,项目名称:tables,代码行数:9,代码来源:DefaultDataSource.php

示例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
开发者ID:JanTvrdik,项目名称:NetteExtras,代码行数:3,代码来源:loader.php

示例14: getCount

 /**
  * Get count of data
  * @return int
  */
 public function getCount()
 {
     return $this->data_source->count($this->primary_key);
 }
开发者ID:martinknor,项目名称:datagrid,代码行数:8,代码来源:NetteDatabaseTableDataSource.php

示例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;
 }
开发者ID:jandlouhy,项目名称:tabletools,代码行数:12,代码来源:Repository.php


注:本文中的Nette\Database\Table\Selection::count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。