コード例 #1
0
ファイル: Limit.php プロジェクト: nnnnathann/piwik
 /**
  * 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);
     }
 }