Piwik\DataTable::addSummaryRow PHP Метод

addSummaryRow() публичный Метод

_Note: A DataTable can have only one summary row._
public addSummaryRow ( Row $row ) : Row
$row Piwik\DataTable\Row
Результат Piwik\DataTable\Row Returns `$row`.
    public function addSummaryRow(Row $row)
    {
        $this->summaryRow = $row;
        // add summary row to index
        if (!$this->indexNotUpToDate && $this->rebuildIndexContinuously) {
            $label = $row->getColumn('label');
            if ($label !== false) {
                $this->rowsIndexByLabel[$label] = self::ID_SUMMARY_ROW;
            }
        }
        return $row;
    }

Usage Example

 public function test_filter_shouldIgnoreSummaryRow()
 {
     $row = $this->buildRow(array('label' => 'other'));
     $this->table->addSummaryRow($row);
     $this->table->filter($this->filter, array('UTC', 'day', 'today'));
     $this->assertFalse($row->getMetadata('segmentValue'));
 }
All Usage Examples Of Piwik\DataTable::addSummaryRow