protected function _build($type) { parent::_build($type); if ($type === Database::SELECT) { if ($this->paginator !== NULL) { $this->_db_builder->limit($this->paginator->count_per_page())->offset($this->paginator->current_offset()); } else { if (!isset($this->_db_applied['limit'])) { if (!empty($this->_limit)) { $this->_db_builder->limit($this->_limit); } } } } return $this; }