truncateAfter = $truncateAfter; } /** * Truncates the table after X rows and adds a summary row * * @param Piwik_DataTable $table */ public function filter($table) { $table->filter('AddSummaryRow', array($this->truncateAfter)); $table->filter('ReplaceSummaryRowLabel'); foreach ($table->getRows() as $row) { if ($row->isSubtableLoaded()) { $idSubTable = $row->getIdSubDataTable(); $subTable = Piwik_DataTable_Manager::getInstance()->getTable($idSubTable); $subTable->filter('Truncate', array($this->truncateAfter)); } } } }