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

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. declare(strict_types=1);
  7. namespace eZ\Publish\Core\Repository\SiteAccessAware;
  8. use eZ\Publish\API\Repository\Repository as RepositoryInterface;
  9. use eZ\Publish\API\Repository\NotificationService as NotificationServiceInterface;
  10. use eZ\Publish\API\Repository\BookmarkService as BookmarkServiceInterface;
  11. use eZ\Publish\API\Repository\ContentService as ContentServiceInterface;
  12. use eZ\Publish\API\Repository\ContentTypeService as ContentTypeServiceInterface;
  13. use eZ\Publish\API\Repository\FieldTypeService as FieldTypeServiceInterface;
  14. use eZ\Publish\API\Repository\LanguageService as LanguageServiceInterface;
  15. use eZ\Publish\API\Repository\LocationService as LocationServiceInterface;
  16. use eZ\Publish\API\Repository\ObjectStateService as ObjectStateServiceInterface;
  17. use eZ\Publish\API\Repository\PermissionResolver as PermissionResolverInterface;
  18. use eZ\Publish\API\Repository\RoleService as RoleServiceInterface;
  19. use eZ\Publish\API\Repository\SearchService as SearchServiceInterface;
  20. use eZ\Publish\API\Repository\SectionService as SectionServiceInterface;
  21. use eZ\Publish\API\Repository\TrashService as TrashServiceInterface;
  22. use eZ\Publish\API\Repository\URLAliasService as URLAliasServiceInterface;
  23. use eZ\Publish\API\Repository\URLService as URLServiceInterface;
  24. use eZ\Publish\API\Repository\URLWildcardService as URLWildcardServiceInterface;
  25. use eZ\Publish\API\Repository\UserPreferenceService as UserPreferenceServiceInterface;
  26. use eZ\Publish\API\Repository\UserService as UserServiceInterface;
  27. /**
  28.  * Repository class.
  29.  */
  30. class Repository implements RepositoryInterface
  31. {
  32.     /** @var \eZ\Publish\API\Repository\Repository */
  33.     protected $repository;
  34.     /** @var \eZ\Publish\API\Repository\ContentService */
  35.     protected $contentService;
  36.     /** @var \eZ\Publish\API\Repository\SectionService */
  37.     protected $sectionService;
  38.     /** @var \eZ\Publish\API\Repository\SearchService */
  39.     protected $searchService;
  40.     /** @var \eZ\Publish\API\Repository\UserService */
  41.     protected $userService;
  42.     /** @var \eZ\Publish\API\Repository\LanguageService */
  43.     protected $languageService;
  44.     /** @var \eZ\Publish\API\Repository\LocationService */
  45.     protected $locationService;
  46.     /** @var \eZ\Publish\API\Repository\TrashService */
  47.     protected $trashService;
  48.     /** @var \eZ\Publish\API\Repository\ContentTypeService */
  49.     protected $contentTypeService;
  50.     /** @var \eZ\Publish\API\Repository\ObjectStateService */
  51.     protected $objectStateService;
  52.     /** @var \eZ\Publish\API\Repository\URLAliasService */
  53.     protected $urlAliasService;
  54.     /** @var \eZ\Publish\Core\Repository\NotificationService */
  55.     protected $notificationService;
  56.     /**
  57.      * Construct repository object from aggregated repository.
  58.      */
  59.     public function __construct(
  60.         RepositoryInterface $repository,
  61.         ContentService $contentService,
  62.         ContentTypeService $contentTypeService,
  63.         ObjectStateService $objectStateService,
  64.         URLAliasService $urlAliasService,
  65.         UserService $userService,
  66.         SearchService $searchService,
  67.         SectionService $sectionService,
  68.         TrashService $trashService,
  69.         LocationService $locationService,
  70.         LanguageService $languageService,
  71.         NotificationService $notificationService
  72.     ) {
  73.         $this->repository $repository;
  74.         $this->contentService $contentService;
  75.         $this->contentTypeService $contentTypeService;
  76.         $this->objectStateService $objectStateService;
  77.         $this->urlAliasService $urlAliasService;
  78.         $this->userService $userService;
  79.         $this->searchService $searchService;
  80.         $this->sectionService $sectionService;
  81.         $this->trashService $trashService;
  82.         $this->locationService $locationService;
  83.         $this->languageService $languageService;
  84.         $this->notificationService $notificationService;
  85.     }
  86.     public function sudo(callable $callback, ?RepositoryInterface $outerRepository null)
  87.     {
  88.         return $this->repository->sudo($callback$outerRepository ?? $this);
  89.     }
  90.     public function getContentService(): ContentServiceInterface
  91.     {
  92.         return $this->contentService;
  93.     }
  94.     public function getContentLanguageService(): LanguageServiceInterface
  95.     {
  96.         return $this->languageService;
  97.     }
  98.     public function getContentTypeService(): ContentTypeServiceInterface
  99.     {
  100.         return $this->contentTypeService;
  101.     }
  102.     public function getLocationService(): LocationServiceInterface
  103.     {
  104.         return $this->locationService;
  105.     }
  106.     public function getTrashService(): TrashServiceInterface
  107.     {
  108.         return $this->trashService;
  109.     }
  110.     public function getSectionService(): SectionServiceInterface
  111.     {
  112.         return $this->sectionService;
  113.     }
  114.     public function getUserService(): UserServiceInterface
  115.     {
  116.         return $this->userService;
  117.     }
  118.     public function getURLAliasService(): URLAliasServiceInterface
  119.     {
  120.         return $this->urlAliasService;
  121.     }
  122.     public function getURLWildcardService(): URLWildcardServiceInterface
  123.     {
  124.         return $this->repository->getURLWildcardService();
  125.     }
  126.     public function getObjectStateService(): ObjectStateServiceInterface
  127.     {
  128.         return $this->objectStateService;
  129.     }
  130.     public function getRoleService(): RoleServiceInterface
  131.     {
  132.         return $this->repository->getRoleService();
  133.     }
  134.     public function getSearchService(): SearchServiceInterface
  135.     {
  136.         return $this->searchService;
  137.     }
  138.     public function getFieldTypeService(): FieldTypeServiceInterface
  139.     {
  140.         return $this->repository->getFieldTypeService();
  141.     }
  142.     public function getPermissionResolver(): PermissionResolverInterface
  143.     {
  144.         return $this->repository->getPermissionResolver();
  145.     }
  146.     public function getURLService(): URLServiceInterface
  147.     {
  148.         return $this->repository->getURLService();
  149.     }
  150.     public function getBookmarkService(): BookmarkServiceInterface
  151.     {
  152.         return $this->repository->getBookmarkService();
  153.     }
  154.     public function getNotificationService(): NotificationServiceInterface
  155.     {
  156.         return $this->repository->getNotificationService();
  157.     }
  158.     public function getUserPreferenceService(): UserPreferenceServiceInterface
  159.     {
  160.         return $this->repository->getUserPreferenceService();
  161.     }
  162.     public function beginTransaction(): void
  163.     {
  164.         $this->repository->beginTransaction();
  165.     }
  166.     public function commit(): void
  167.     {
  168.         $this->repository->commit();
  169.     }
  170.     public function rollback(): void
  171.     {
  172.         $this->repository->rollback();
  173.     }
  174. }