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

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\TrashService as TrashServiceInterface;
  9. use eZ\Publish\API\Repository\Values\Content\TrashItem;
  10. use eZ\Publish\API\Repository\Values\Content\Location;
  11. use eZ\Publish\API\Repository\Values\Content\Query;
  12. use eZ\Publish\API\Repository\Values\Content\Trash\SearchResult;
  13. use eZ\Publish\API\Repository\Values\Content\Trash\TrashItemDeleteResult;
  14. use eZ\Publish\API\Repository\Values\Content\Trash\TrashItemDeleteResultList;
  15. /**
  16.  * TrashService for SiteAccessAware layer.
  17.  *
  18.  * Currently does nothing but hand over calls to aggregated service.
  19.  */
  20. class TrashService implements TrashServiceInterface
  21. {
  22.     /** @var \eZ\Publish\API\Repository\TrashService */
  23.     protected $service;
  24.     /**
  25.      * Construct service object from aggregated service.
  26.      *
  27.      * @param \eZ\Publish\API\Repository\TrashService $service
  28.      */
  29.     public function __construct(
  30.         TrashServiceInterface $service
  31.     ) {
  32.         $this->service $service;
  33.     }
  34.     public function loadTrashItem(int $trashItemId): TrashItem
  35.     {
  36.         return $this->service->loadTrashItem($trashItemId);
  37.     }
  38.     public function trash(Location $location): ?TrashItem
  39.     {
  40.         return $this->service->trash($location);
  41.     }
  42.     public function recover(TrashItem $trashItemLocation $newParentLocation null): Location
  43.     {
  44.         return $this->service->recover($trashItem$newParentLocation);
  45.     }
  46.     public function emptyTrash(): TrashItemDeleteResultList
  47.     {
  48.         return $this->service->emptyTrash();
  49.     }
  50.     public function deleteTrashItem(TrashItem $trashItem): TrashItemDeleteResult
  51.     {
  52.         return $this->service->deleteTrashItem($trashItem);
  53.     }
  54.     public function findTrashItems(Query $query): SearchResult
  55.     {
  56.         return $this->service->findTrashItems($query);
  57.     }
  58. }