[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_finder/src/Extension/ -> FinderComponent.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_finder
   6   *
   7   * @copyright   (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  namespace Joomla\Component\Finder\Administrator\Extension;
  12  
  13  use Joomla\CMS\Component\Router\RouterServiceInterface;
  14  use Joomla\CMS\Component\Router\RouterServiceTrait;
  15  use Joomla\CMS\Extension\BootableExtensionInterface;
  16  use Joomla\CMS\Extension\MVCComponent;
  17  use Joomla\CMS\HTML\HTMLRegistryAwareTrait;
  18  use Joomla\Component\Finder\Administrator\Service\HTML\Filter;
  19  use Joomla\Component\Finder\Administrator\Service\HTML\Finder;
  20  use Joomla\Component\Finder\Administrator\Service\HTML\Query;
  21  use Joomla\Database\DatabaseInterface;
  22  use Psr\Container\ContainerInterface;
  23  
  24  // phpcs:disable PSR1.Files.SideEffects
  25  \defined('JPATH_PLATFORM') or die;
  26  // phpcs:enable PSR1.Files.SideEffects
  27  
  28  /**
  29   * Component class for com_finder
  30   *
  31   * @since  4.0.0
  32   */
  33  class FinderComponent extends MVCComponent implements BootableExtensionInterface, RouterServiceInterface
  34  {
  35      use RouterServiceTrait;
  36      use HTMLRegistryAwareTrait;
  37  
  38      /**
  39       * Booting the extension. This is the function to set up the environment of the extension like
  40       * registering new class loaders, etc.
  41       *
  42       * If required, some initial set up can be done from services of the container, eg.
  43       * registering HTML services.
  44       *
  45       * @param   ContainerInterface  $container  The container
  46       *
  47       * @return  void
  48       *
  49       * @since   4.0.0
  50       */
  51      public function boot(ContainerInterface $container)
  52      {
  53          $finder = new Finder();
  54          $finder->setDatabase($container->get(DatabaseInterface::class));
  55  
  56          $this->getRegistry()->register('finder', $finder);
  57  
  58          $filter = new Filter();
  59          $filter->setDatabase($container->get(DatabaseInterface::class));
  60  
  61          $this->getRegistry()->register('filter', $filter);
  62  
  63          $this->getRegistry()->register('query', new Query());
  64      }
  65  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer