Piwik\DataTable::getRows PHP Method

getRows() public method

Returns the array of Rows.
public getRows ( ) : Row[]
return Piwik\DataTable\Row[]
    public function getRows()
    {
        if (is_null($this->summaryRow)) {
            return $this->rows;
        } else {
            return $this->rows + array(self::ID_SUMMARY_ROW => $this->summaryRow);
        }
    }

Usage Example

 protected function assertColumnValues($rowsWithValues)
 {
     $index = 0;
     foreach ($this->table->getRows() as $row) {
         $rowToCheck = $rowsWithValues[$index];
         foreach ($rowToCheck as $columnToCheck => $expectedValue) {
             $actualValue = $row->getColumn($columnToCheck);
             $this->assertEquals($expectedValue, $actualValue, "{$columnToCheck} in row {$index} does not match assumed {$actualValue} is {$expectedValue}");
         }
         $index++;
     }
     $this->assertEquals(count($rowsWithValues), $this->table->getRowsCount());
 }
All Usage Examples Of Piwik\DataTable::getRows