vendor/ezsystems/ezplatform-kernel/eZ/Publish/Core/Repository/SiteAccessAware/LanguageService.php line 18

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\Publish\Core\Repository\SiteAccessAware;
  7. use eZ\Publish\API\Repository\LanguageService as LanguageServiceInterface;
  8. use eZ\Publish\API\Repository\Values\Content\LanguageCreateStruct;
  9. use eZ\Publish\API\Repository\Values\Content\Language;
  10. /**
  11.  * LanguageService for SiteAccessAware layer.
  12.  *
  13.  * Currently does nothing but hand over calls to aggregated service.
  14.  */
  15. class LanguageService implements LanguageServiceInterface
  16. {
  17.     /** @var \eZ\Publish\API\Repository\LanguageService */
  18.     protected $service;
  19.     /**
  20.      * Construct service object from aggregated service.
  21.      *
  22.      * @param \eZ\Publish\API\Repository\LanguageService $service
  23.      */
  24.     public function __construct(
  25.         LanguageServiceInterface $service
  26.     ) {
  27.         $this->service $service;
  28.     }
  29.     public function createLanguage(LanguageCreateStruct $languageCreateStruct): Language
  30.     {
  31.         return $this->service->createLanguage($languageCreateStruct);
  32.     }
  33.     public function updateLanguageName(Language $languagestring $newName): Language
  34.     {
  35.         return $this->service->updateLanguageName($language$newName);
  36.     }
  37.     public function enableLanguage(Language $language): Language
  38.     {
  39.         return $this->service->enableLanguage($language);
  40.     }
  41.     public function disableLanguage(Language $language): Language
  42.     {
  43.         return $this->service->disableLanguage($language);
  44.     }
  45.     public function loadLanguage(string $languageCode): Language
  46.     {
  47.         return $this->service->loadLanguage($languageCode);
  48.     }
  49.     public function loadLanguages(): iterable
  50.     {
  51.         return $this->service->loadLanguages();
  52.     }
  53.     public function loadLanguageById(int $languageId): Language
  54.     {
  55.         return $this->service->loadLanguageById($languageId);
  56.     }
  57.     public function loadLanguageListByCode(array $languageCodes): iterable
  58.     {
  59.         return $this->service->loadLanguageListByCode($languageCodes);
  60.     }
  61.     public function loadLanguageListById(array $languageIds): iterable
  62.     {
  63.         return $this->service->loadLanguageListById($languageIds);
  64.     }
  65.     public function deleteLanguage(Language $language): void
  66.     {
  67.         $this->service->deleteLanguage($language);
  68.     }
  69.     public function getDefaultLanguageCode(): string
  70.     {
  71.         return $this->service->getDefaultLanguageCode();
  72.     }
  73.     public function newLanguageCreateStruct(): LanguageCreateStruct
  74.     {
  75.         return $this->service->newLanguageCreateStruct();
  76.     }
  77. }