Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4] remove method allow parent to run #34118

Merged
merged 2 commits into from
May 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 18 additions & 17 deletions components/com_content/src/Model/ArchiveModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down