- md5
- 27bca4f2960ebdd84f550ee0499478a2
- sha1
- fff615e590c8d12cbebc96131af17a660916ff78
- sha256
- 7d1c757cada78ea599df7f5ed6856eba52811e829ed980927dd6cb40f0c82903
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
<?php
/**
* @package Joomla.Administrator
* @subpackage com_banners
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Banners\Administrator\Extension;
use Joomla\CMS\Categories\CategoryServiceInterface;
use Joomla\CMS\Categories\CategoryServiceTrait;
use Joomla\CMS\Component\Router\RouterServiceInterface;
use Joomla\CMS\Component\Router\RouterServiceTrait;
use Joomla\CMS\Extension\BootableExtensionInterface;
use Joomla\CMS\Extension\MVCComponent;
use Joomla\CMS\HTML\HTMLRegistryAwareTrait;
use Joomla\CMS\Tag\TagServiceInterface;
use Joomla\CMS\Tag\TagServiceTrait;
use Joomla\Component\Banners\Administrator\Service\Html\Banner;
use Joomla\Database\DatabaseInterface;
use Psr\Container\ContainerInterface;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Component class for com_banners
*
* @since 4.0.0
*/
class BannersComponent extends MVCComponent implements
BootableExtensionInterface,
CategoryServiceInterface,
RouterServiceInterface,
TagServiceInterface
{
use HTMLRegistryAwareTrait;
use RouterServiceTrait;
use CategoryServiceTrait, TagServiceTrait {
CategoryServiceTrait::getTableNameForSection insteadof TagServiceTrait;
CategoryServiceTrait::getStateColumnForSection insteadof TagServiceTrait;
}
/**
* 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)
{
$banner = new Banner();
$banner->setDatabase($container->get(DatabaseInterface::class));
$this->getRegistry()->register('banner', $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 41 releases, Joomla 5.0.0-alpha1 to 5.2.0-alpha3. See them all, or every version of this file.