CoreFiles by mySites.guru
helper.php50 lines, 1,159 bytes, from Joomla_3.6.4-Stable-Full_Package.zip
Raw History Compare with 3.6.3
md5
f784dd8fee84ba8a6fb4a80bd534d09a
sha1
2c2ede08671b57d8762907434c54edca4dba8fa4
sha256
32064d9e6361b47c8ea41e2fdecf02275ffeae53f81a758cbffa60292a044614
<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_articles_categories
 *
 * @copyright   Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php');

/**
 * 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();

			if ($params->get('count', 0) > 0 && count($items) > $params->get('count', 0))
			{
				$items = array_slice($items, 0, $params->get('count', 0));
			}

			return $items;
		}
	}
}

The same content is in 6 releases, Joomla 3.6.3-rc1 to 3.6.5. See them all, or every version of this file.