_cursor = $cursor; } /** * Returns an cursor limited to items for a page. * * @param integer $offset Page offset * @param integer $itemCountPerPage Number of items per page * @return MongoDB\Driver\Cursor */ public function getItems($offset, $itemCountPerPage) { $cursor = $this->_cursor->skip($offset)->limit($itemCountPerPage); return $cursor; } /** * Returns the total number of rows in the cursor. * * @return integer */ public function count() { return count($this->_cursor->toArray()); } }