Piwik\DataTable::getRowsCount PHP Method

getRowsCount() public method

Returns the number of rows in the table including the summary row.
public getRowsCount ( ) : integer
return integer
    public function getRowsCount()
    {
        if (is_null($this->summaryRow)) {
            return count($this->rows);
        } else {
            return count($this->rows) + 1;
        }
    }

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::getRowsCount