vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Controller.php line 28

Open in your IDE?
  1. <?php
  2. /**
  3.  * @copyright Copyright (C) eZ Systems AS. All rights reserved.
  4.  * @license For full copyright and license information view LICENSE file distributed with this source code.
  5.  */
  6. namespace eZ\Bundle\EzPublishCoreBundle;
  7. use Symfony\Bundle\FrameworkBundle\Controller\Controller as BaseController;
  8. class Controller extends BaseController
  9. {
  10.     /**
  11.      * @throws \LogicException
  12.      *
  13.      * @return \eZ\Publish\API\Repository\Repository
  14.      */
  15.     public function getRepository()
  16.     {
  17.         return $this->container->get('ezpublish.api.repository');
  18.     }
  19.     /**
  20.      * @return \eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\ConfigResolver
  21.      */
  22.     protected function getConfigResolver()
  23.     {
  24.         return $this->container->get('ezpublish.config.resolver');
  25.     }
  26.     /**
  27.      * Returns the general helper service, exposed in Twig templates as "ezpublish" global variable.
  28.      *
  29.      * @return \eZ\Publish\Core\MVC\Legacy\Templating\GlobalHelper
  30.      */
  31.     public function getGlobalHelper()
  32.     {
  33.         return $this->container->get('ezpublish.templating.global_helper');
  34.     }
  35.     /**
  36.      * Returns the root location object for current siteaccess configuration.
  37.      *
  38.      * @return \eZ\Publish\API\Repository\Values\Content\Location
  39.      */
  40.     public function getRootLocation()
  41.     {
  42.         return $this->getGlobalHelper()->getRootLocation();
  43.     }
  44. }