當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataTable::getRowsCountRecursive方法代碼示例

本文整理匯總了PHP中Piwik\DataTable::getRowsCountRecursive方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataTable::getRowsCountRecursive方法的具體用法?PHP DataTable::getRowsCountRecursive怎麽用?PHP DataTable::getRowsCountRecursive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Piwik\DataTable的用法示例。


在下文中一共展示了DataTable::getRowsCountRecursive方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testCountRowsComplex

 /**
  * we test the count rows and the count rows recursive version
  * on a Complex array (rows with 2 and 3 levels only)
  *
  * the recursive count returns
  *         the sum of the number of rows of all the subtables
  *         + the number of rows in the parent table
  */
 public function testCountRowsComplex()
 {
     $idcol = Row::COLUMNS;
     $idsubtable = Row::DATATABLE_ASSOCIATED;
     // table to go in the SUB table of RoW1
     $tableSubOfSubOfRow1 = new DataTable();
     $rows1sub = array(array($idcol => array('label' => 'google')), array($idcol => array('label' => 'google78')), array($idcol => array('label' => 'googlaegge')), array($idcol => array('label' => 'gogeoggle')), array($idcol => array('label' => 'goaegaegaogle')), array($idcol => array('label' => 'ask')), array($idcol => array('label' => '238975247578949')));
     $tableSubOfSubOfRow1->addRowsFromArray($rows1sub);
     // table to go in row1
     $tableSubOfRow1 = new DataTable();
     $rows1 = array(array($idcol => array('label' => 'google'), $idsubtable => $tableSubOfSubOfRow1), array($idcol => array('label' => 'ask')), array($idcol => array('label' => '238975247578949')));
     $tableSubOfRow1->addRowsFromArray($rows1);
     // table to go in row2
     $tableSubOfRow2 = new DataTable();
     $rows2 = array(array($idcol => array('label' => 'google')), array($idcol => array('label' => 'ask')), array($idcol => array('label' => '238975247578949')), array($idcol => array('label' => 'agaegaesk')), array($idcol => array('label' => '23g  8975247578949')));
     $tableSubOfRow2->addRowsFromArray($rows2);
     // main parent table
     $table = new DataTable();
     $rows = array(array($idcol => array('label' => 'row1')), array($idcol => array('label' => 'row2'), $idsubtable => $tableSubOfRow1), array($idcol => array('label' => 'row3'), $idsubtable => $tableSubOfRow2));
     $table->addRowsFromArray($rows);
     $this->assertEquals(3, $table->getRowsCount());
     $this->assertEquals(18, $table->getRowsCountRecursive());
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:31,代碼來源:DataTableTest.php

示例2: rememberNumberOfSites

 private function rememberNumberOfSites()
 {
     $this->numSites = $this->sitesByGroup->getRowsCountRecursive();
 }
開發者ID:piwik,項目名稱:piwik,代碼行數:4,代碼來源:Dashboard.php

示例3: search

 public function search($pattern)
 {
     $this->nestedSearch($this->sitesByGroup, $pattern);
     $this->numSites = $this->sitesByGroup->getRowsCountRecursive();
 }
開發者ID:bossrabbit,項目名稱:piwik,代碼行數:5,代碼來源:Dashboard.php


注:本文中的Piwik\DataTable::getRowsCountRecursive方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。