CoreFiles by mySites.guru
helper.php50 lines, 1,045 bytes, from Joomla_3.9.2-Stable-Full_Package.zip
Raw History Compare with 3.9.1
md5
6bfd5ccf33b99ce28ea7256865b76767
sha1
350a975cf096fbf99c5479fa369fb2573dba639c
sha256
d9c3e74c22593062e3c0717e130696f224c6cc945a9ec10ba6f35d288f342336
<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_articles_categories
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Helper for mod_articles_categories
 *
 * @since  1.5
 */
abstract class ModArticlesCategoriesHelper
{
	/**
	 * Get list of articles
	 *
	 * @param   \Joomla\Registry\Registry  &$params  module parameters
	 *
	 * @return  array
	 *
	 * @since   1.5
	 */
	public static function getList(&$params)
	{
		$options               = array();
		$options['countItems'] = $params->get('numitems', 0);

		$categories = JCategories::getInstance('Content', $options);
		$category   = $categories->get($params->get('parent', 'root'));

		if ($category !== null)
		{
			$items = $category->getChildren();

			$count = $params->get('count', 0);

			if ($count > 0 && count($items) > $count)
			{
				$items = array_slice($items, 0, $count);
			}

			return $items;
		}
	}
}

The same content is in 26 releases, Joomla 3.9.2-rc to 3.9.14. See them all, or every version of this file.