CoreFiles by mySites.guru
SystemHeader.php123 lines, 1,954 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
63a360b34cf61b5e31c6bd3378889f73
sha1
ba6e0a4c287e41f24457ebb44f09122762c6a8c7
sha256
a068786ca92349c8ee6cf9d50aef5d0f784d5409c9a30c31a060a1e05ffac83e
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_cpanel
 *
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Cpanel\Administrator\Entities;

defined('_JEXEC') or die;

/**
 * Class representing a section in the system view.
 *
 * @since  4.0.0
 */
class SystemHeader
{
	/**
	 * The class for an icon to display for the header
	 *
	 * @var string
	 *
	 * @since  4.0.0
	 */
	private $icon;

	/**
	 * The title of the header
	 *
	 * @var string
	 *
	 * @since  4.0.0
	 */
	private $title;

	/**
	 * The list of items in this section
	 *
	 * @var SystemItem[]
	 *
	 * @since  4.0.0
	 */
	private $items = [];

	/**
	 * SystemHeader constructor.
	 *
	 * @param   string  $title  The title of the header
	 * @param   string  $icon   The class for an icon to display for the header
	 *
	 * @since  4.0.0
	 */
	public function __construct($title, $icon)
	{
		$this->title = $title;
		$this->icon  = $icon;
	}

	/**
	 * Method to add an item to the section
	 *
	 * @param   SystemItem  $item  The item to add to this section
	 *
	 * @return  void
	 *
	 * @since  4.0.0
	 */
	public function addItem(SystemItem $item)
	{
		$this->items[] = $item;
	}

	/**
	 * Get the icon associated with the section
	 *
	 * @return string
	 *
	 * @since  4.0.0
	 */
	public function getIcon()
	{
		return $this->icon;
	}

	/**
	 * Get the title associated with the section
	 *
	 * @return string
	 *
	 * @since  4.0.0
	 */
	public function getTitle()
	{
		return $this->title;
	}

	/**
	 * Get the items added into the section
	 *
	 * @return  SystemItem[]
	 *
	 * @since  4.0.0
	 */
	public function getItems()
	{
		return $this->items;
	}

	/**
	 * Does the section contain any items
	 *
	 * @return  boolean
	 *
	 * @since  4.0.0
	 */
	public function hasItems()
	{
		return count($this->items) !== 0;
	}
}

No other release has this exact content. See every version of this file.