_query = $query; } /** * Get items * * @param int $offset * @param int $itemsPerPage * @return Doctrine_Collection */ public function getItems($offset, $itemsPerPage) { return $this->_query ->limit($itemsPerPage) ->offset($offset) ->execute(); } /** * Count results * * @return int */ public function count() { if ($this->_rowCount === null) { $this->_rowCount = $this->_query->count(); } return $this->_rowCount; } }