public function setPage($page = 1) { if (!$this->limit) { throw new DbException("Please setup limit for use method `setPage`"); } $this->offset = $this->limit * ($page - 1); return $this; }