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

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\SectionService as SectionServiceInterface;
  9. use eZ\Publish\API\Repository\Values\Content\Location;
  10. use eZ\Publish\API\Repository\Values\Content\SectionCreateStruct;
  11. use eZ\Publish\API\Repository\Values\Content\SectionUpdateStruct;
  12. use eZ\Publish\API\Repository\Values\Content\Section;
  13. use eZ\Publish\API\Repository\Values\Content\ContentInfo;
  14. /**
  15.  * SectionService for SiteAccessAware layer.
  16.  *
  17.  * Currently does nothing but hand over calls to aggregated service.
  18.  */
  19. class SectionService implements SectionServiceInterface
  20. {
  21.     /** @var \eZ\Publish\API\Repository\SectionService */
  22.     protected $service;
  23.     /**
  24.      * Construct service object from aggregated service.
  25.      *
  26.      * @param \eZ\Publish\API\Repository\SectionService $service
  27.      */
  28.     public function __construct(
  29.         SectionServiceInterface $service
  30.     ) {
  31.         $this->service $service;
  32.     }
  33.     public function createSection(SectionCreateStruct $sectionCreateStruct): Section
  34.     {
  35.         return $this->service->createSection($sectionCreateStruct);
  36.     }
  37.     public function updateSection(Section $sectionSectionUpdateStruct $sectionUpdateStruct): Section
  38.     {
  39.         return $this->service->updateSection($section$sectionUpdateStruct);
  40.     }
  41.     public function loadSection(int $sectionId): Section
  42.     {
  43.         return $this->service->loadSection($sectionId);
  44.     }
  45.     public function loadSections(): iterable
  46.     {
  47.         return $this->service->loadSections();
  48.     }
  49.     public function loadSectionByIdentifier(string $sectionIdentifier): Section
  50.     {
  51.         return $this->service->loadSectionByIdentifier($sectionIdentifier);
  52.     }
  53.     public function countAssignedContents(Section $section): int
  54.     {
  55.         return $this->service->countAssignedContents($section);
  56.     }
  57.     public function isSectionUsed(Section $section): bool
  58.     {
  59.         return $this->service->isSectionUsed($section);
  60.     }
  61.     public function assignSection(ContentInfo $contentInfoSection $section): void
  62.     {
  63.         $this->service->assignSection($contentInfo$section);
  64.     }
  65.     public function assignSectionToSubtree(Location $locationSection $section): void
  66.     {
  67.         $this->service->assignSectionToSubtree($location$section);
  68.     }
  69.     public function deleteSection(Section $section): void
  70.     {
  71.         $this->service->deleteSection($section);
  72.     }
  73.     public function newSectionCreateStruct(): SectionCreateStruct
  74.     {
  75.         return $this->service->newSectionCreateStruct();
  76.     }
  77.     public function newSectionUpdateStruct(): SectionUpdateStruct
  78.     {
  79.         return $this->service->newSectionUpdateStruct();
  80.     }
  81. }