當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。