vendor/ezsystems/ezplatform-kernel/eZ/Bundle/EzPublishCoreBundle/SiteAccess/LanguageResolver.php line 15

Open in your IDE?
  1. <?php
  2. /**
  3.  * @copyright Copyright (C) Ibexa 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\SiteAccess;
  7. use eZ\Publish\Core\MVC\ConfigResolverInterface;
  8. use eZ\Publish\Core\Repository\SiteAccessAware\Language\AbstractLanguageResolver;
  9. /**
  10.  * Resolves language settings for use in SiteAccess aware Repository.
  11.  */
  12. final class LanguageResolver extends AbstractLanguageResolver
  13. {
  14.     /** @var \eZ\Publish\Core\MVC\ConfigResolverInterface */
  15.     private $configResolver;
  16.     public function __construct(
  17.         ConfigResolverInterface $configResolver,
  18.         bool $defaultUseAlwaysAvailable true,
  19.         bool $defaultShowAllTranslations false
  20.     ) {
  21.         $this->configResolver $configResolver;
  22.         parent::__construct($defaultUseAlwaysAvailable$defaultShowAllTranslations);
  23.     }
  24.     /**
  25.      * Get list of languages configured via scope/SiteAccess context.
  26.      *
  27.      * @return string[]
  28.      */
  29.     protected function getConfiguredLanguages(): array
  30.     {
  31.         return $this->configResolver->getParameter('languages');
  32.     }
  33. }