CoreFiles by mySites.guru
BannersComponent.php63 lines, 1,685 bytes, from Joomla_4.0.0-alpha11-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha10
md5
52afd911662570526767c3c79966844d
sha1
c3c1d2e5b6b9916a535c5eeafe63766637e9f022
sha256
63ebb4f2d66b3b2cfeb9d0f2ea42bc6bb5e4b8ad1c8b032c4d5629276c1d084e
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_banners
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Banners\Administrator\Extension;

defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Categories\CategoryServiceInterface;
use Joomla\CMS\Categories\CategoryServiceTrait;
use Joomla\CMS\Extension\BootableExtensionInterface;
use Joomla\CMS\Extension\MVCComponent;
use Joomla\CMS\HTML\HTMLRegistryAwareTrait;
use Joomla\Component\Banners\Administrator\Service\Html\Banner;
use Psr\Container\ContainerInterface;

/**
 * Component class for com_banners
 *
 * @since  4.0.0
 */
class BannersComponent extends MVCComponent implements BootableExtensionInterface, CategoryServiceInterface
{
	use CategoryServiceTrait;
	use HTMLRegistryAwareTrait;

	/**
	 * Booting the extension. This is the function to set up the environment of the extension like
	 * registering new class loaders, etc.
	 *
	 * If required, some initial set up can be done from services of the container, eg.
	 * registering HTML services.
	 *
	 * @param   ContainerInterface  $container  The container
	 *
	 * @return  void
	 *
	 * @since   4.0.0
	 */
	public function boot(ContainerInterface $container)
	{
		$this->getRegistry()->register('banner', new Banner);
	}

	/**
	 * Returns the table for the count items functions for the given section.
	 *
	 * @param   string  $section  The section
	 *
	 * @return  string|null
	 *
	 * @since   4.0.0
	 */
	protected function getTableNameForSection(string $section = null)
	{
		return 'banners';
	}
}

The same content is in 4 releases, Joomla 4.0.0-alpha9 to 4.0.0-alpha12. See them all, or every version of this file.