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


PHP DataTable::getRowFromLabel方法代碼示例

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


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

示例1: doFilterRecursiveDescend

 /**
  * Method for the recursive descend
  *
  * @param array $labelParts
  * @param DataTable $dataTable
  * @return Row|bool
  */
 private function doFilterRecursiveDescend($labelParts, $dataTable)
 {
     // search for the first part of the tree search
     $labelPart = array_shift($labelParts);
     $row = false;
     foreach ($this->getLabelVariations($labelPart) as $labelPart) {
         $row = $dataTable->getRowFromLabel($labelPart);
         if ($row !== false) {
             break;
         }
     }
     if ($row === false) {
         // not found
         return false;
     }
     // end of tree search reached
     if (count($labelParts) == 0) {
         return $row;
     }
     $subTable = $this->loadSubtable($dataTable, $row);
     if ($subTable === null) {
         // no more subtables but label parts left => no match found
         return false;
     }
     return $this->doFilterRecursiveDescend($labelParts, $subTable);
 }
開發者ID:josl,項目名稱:CGE-File-Sharing,代碼行數:33,代碼來源:LabelFilter.php

示例2: doFilterRecursiveDescend

 /**
  * Method for the recursive descend
  *
  * @param array $labelParts
  * @param DataTable $dataTable
  * @return Row|bool
  */
 private function doFilterRecursiveDescend($labelParts, $dataTable)
 {
     // we need to make sure to rebuild the index as some filters change the label column directly via
     // $row->setColumn('label', '') which would not be noticed in the label index otherwise.
     $dataTable->rebuildIndex();
     // search for the first part of the tree search
     $labelPart = array_shift($labelParts);
     $row = false;
     foreach ($this->getLabelVariations($labelPart) as $labelPart) {
         $row = $dataTable->getRowFromLabel($labelPart);
         if ($row !== false) {
             break;
         }
     }
     if ($row === false) {
         // not found
         return false;
     }
     // end of tree search reached
     if (count($labelParts) == 0) {
         return $row;
     }
     $subTable = $this->loadSubtable($dataTable, $row);
     if ($subTable === null) {
         // no more subtables but label parts left => no match found
         return false;
     }
     return $this->doFilterRecursiveDescend($labelParts, $subTable);
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:36,代碼來源:LabelFilter.php

示例3: filter

 /**
  * @param DataTable $table
  */
 public function filter($table)
 {
     $row = $table->getRowFromLabel(Archiver::EVENT_NAME_NOT_SET);
     if ($row) {
         $row->setColumn('label', Piwik::translate('General_NotDefined', Piwik::translate('Events_EventName')));
     }
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:10,代碼來源:ReplaceEventNameNotSet.php

示例4: filter

 /**
  * See {@link ReplaceSummaryRowLabel}.
  *
  * @param DataTable $table
  */
 public function filter($table)
 {
     $row = $table->getRowFromId(DataTable::ID_SUMMARY_ROW);
     if ($row) {
         $row->setColumn('label', $this->newLabel);
     } else {
         $row = $table->getRowFromLabel(DataTable::LABEL_SUMMARY_ROW);
         if ($row) {
             $row->setColumn('label', $this->newLabel);
         }
     }
     // recurse
     foreach ($table->getRowsWithoutSummaryRow() as $row) {
         $subTable = $row->getSubtable();
         if ($subTable) {
             $this->filter($subTable);
         }
     }
 }
開發者ID:bossrabbit,項目名稱:piwik,代碼行數:24,代碼來源:ReplaceSummaryRowLabel.php

示例5: isEqual

 /**
  * Returns true if both DataTable instances are exactly the same.
  *
  * DataTables are equal if they have the same number of rows, if
  * each row has a label that exists in the other table, and if each row
  * is equal to the row in the other table with the same label. The order
  * of rows is not important.
  *
  * @param \Piwik\DataTable $table1
  * @param \Piwik\DataTable $table2
  * @return bool
  */
 public static function isEqual(DataTable $table1, DataTable $table2)
 {
     $table1->rebuildIndex();
     $table2->rebuildIndex();
     if ($table1->getRowsCount() != $table2->getRowsCount()) {
         return false;
     }
     $rows1 = $table1->getRows();
     foreach ($rows1 as $row1) {
         $row2 = $table2->getRowFromLabel($row1->getColumn('label'));
         if ($row2 === false || !Row::isEqual($row1, $row2)) {
             return false;
         }
     }
     return true;
 }
開發者ID:piwik,項目名稱:piwik,代碼行數:28,代碼來源:DataTable.php

示例6: getPastRowFromCurrent

 /**
  * Utility function. Returns the current row in the past DataTable.
  *
  * @param Row $row The row in the 'current' DataTable.
  * @return bool|Row
  */
 protected function getPastRowFromCurrent($row)
 {
     return $this->pastDataTable->getRowFromLabel($row->getColumn('label'));
 }
開發者ID:CaptainSharf,項目名稱:SSAD_Project,代碼行數:10,代碼來源:CalculateEvolutionFilter.php

示例7: getRowFromTable

 private function getRowFromTable(DataTable $table, DataTable\Row $row)
 {
     return $table->getRowFromLabel($row->getColumn('label'));
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:4,代碼來源:Insight.php

示例8: setGroupForSiteId

 private function setGroupForSiteId(DataTable $table, $siteId, $groupName)
 {
     $table->getRowFromLabel('Site' . $siteId)->setMetadata('group', $groupName);
 }
開發者ID:normimuc,項目名稱:piwik,代碼行數:4,代碼來源:DashboardTest.php

示例9: getPastRowFromCurrent

 /**
  * public for Insights use.
  */
 public function getPastRowFromCurrent(Row $row)
 {
     return $this->pastData->getRowFromLabel($row->getColumn('label'));
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:7,代碼來源:EvolutionMetric.php

示例10: assertMoversAndShakers

 private function assertMoversAndShakers(DataTable $report, $movers, $nonMovers)
 {
     foreach ($movers as $mover) {
         $row = $report->getRowFromLabel($mover);
         if (!$row) {
             $this->fail("{$mover} is not a valid label");
             continue;
         }
         $this->assertTrue($row->getColumn('isMoverAndShaker'), "{$mover} is not a mover but should be");
     }
     foreach ($nonMovers as $nonMover) {
         $row = $report->getRowFromLabel($nonMover);
         if (!$row) {
             $this->fail("{$nonMover} is not a valid label");
             continue;
         }
         $this->assertFalse($row->getColumn('isMoverAndShaker'), "{$nonMover} is a mover but should be not");
     }
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:19,代碼來源:InsightReportTest.php


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