/** * Sets the total row count for this paginator * * Can be either an integer, or a Doctrine\ORM\Query object * which returns the count * * @param Query|integer $rowCount * @return void */ public function setRowCount($rowCount) { if ($rowCount instanceof Query) { $this->rowCount = $rowCount->getSingleScalarResult(); } else { if (is_integer($rowCount)) { $this->rowCount = $rowCount; } else { throw new \InvalidArgumentException("Invalid row count"); } } }