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


PHP Piwik_DataTable::getRowFromId方法代碼示例

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


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

示例1: filter

 /**
  * Adds a summary row to the given data table
  *
  * @param Piwik_DataTable  $table
  */
 public function filter($table)
 {
     if ($table->getRowsCount() <= $this->startRowToSummarize + 1) {
         return;
     }
     $table->filter('Sort', array($this->columnToSortByBeforeTruncating, 'desc'));
     $rows = $table->getRows();
     $count = $table->getRowsCount();
     $newRow = new Piwik_DataTable_Row();
     for ($i = $this->startRowToSummarize; $i < $count; $i++) {
         if (!isset($rows[$i])) {
             // case when the last row is a summary row, it is not indexed by $cout but by Piwik_DataTable::ID_SUMMARY_ROW
             $summaryRow = $table->getRowFromId(Piwik_DataTable::ID_SUMMARY_ROW);
             //FIXME: I'm not sure why it could return false, but it was reported in: http://forum.piwik.org/read.php?2,89324,page=1#msg-89442
             if ($summaryRow) {
                 $newRow->sumRow($summaryRow, $enableCopyMetadata = false);
             }
         } else {
             $newRow->sumRow($rows[$i], $enableCopyMetadata = false);
         }
     }
     $newRow->setColumns(array('label' => $this->labelSummaryRow) + $newRow->getColumns());
     if ($this->deleteRows) {
         $table->filter('Limit', array(0, $this->startRowToSummarize));
     }
     $table->addSummaryRow($newRow);
     unset($rows);
 }
開發者ID:nomoto-ubicast,項目名稱:piwik,代碼行數:33,代碼來源:AddSummaryRow.php

示例2: filter

 /**
  * Limits the given data table
  *
  * @param Piwik_DataTable  $table
  */
 public function filter($table)
 {
     $table->setRowsCountBeforeLimitFilter();
     if ($this->keepSummaryRow) {
         $summaryRow = $table->getRowFromId(Piwik_DataTable::ID_SUMMARY_ROW);
     }
     // we delete from 0 to offset
     if ($this->offset > 0) {
         $table->deleteRowsOffset(0, $this->offset);
     }
     // at this point the array has offset less elements. We delete from limit to the end
     if ($this->limit >= 0) {
         $table->deleteRowsOffset($this->limit);
     }
     if ($this->keepSummaryRow && $summaryRow) {
         $table->addSummaryRow($summaryRow);
     }
 }
開發者ID:nnnnathann,項目名稱:piwik,代碼行數:23,代碼來源:Limit.php


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