diff --git a/components/com_content/src/Model/ArchiveModel.php b/components/com_content/src/Model/ArchiveModel.php index b4a707e75c85e..50f236369c069 100644 --- a/components/com_content/src/Model/ArchiveModel.php +++ b/components/com_content/src/Model/ArchiveModel.php @@ -130,30 +130,31 @@ protected function getListQuery() } /** - * Model override to add alternating value for $odd + * Method to get the archived article list * - * @param string $query The query. - * @param integer $limitstart Offset. - * @param integer $limit The number of records. - * - * @return array An array of results. - * - * @since 3.0.1 - * @throws \RuntimeException + * @access public + * @return array */ - protected function _getList($query, $limitstart=0, $limit=0) + public function getData() { - $result = parent::_getList($query, $limitstart, $limit); - - $odd = 1; + $app = Factory::getApplication(); - foreach ($result as $k => $row) + // Lets load the content if it doesn't already exist + if (empty($this->_data)) { - $result[$k]->odd = $odd; - $odd = 1 - $odd; + // Get the page/component configuration + $params = $app->getParams(); + + // Get the pagination request variables + $limit = $app->input->get('limit', $params->get('display_num', 20), 'uint'); + $limitstart = $app->input->get('limitstart', 0, 'uint'); + + $query = $this->_buildQuery(); + + $this->_data = $this->_getList($query, $limitstart, $limit); } - return $result; + return $this->_data; } /**