custom/plugins/SwagPayPal/src/Util/Compatibility/EntityRepositoryDecorator.php line 42

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. /*
  3.  * (c) shopware AG <info@shopware.com>
  4.  * For the full copyright and license information, please view the LICENSE
  5.  * file that was distributed with this source code.
  6.  */
  7. namespace Swag\PayPal\Util\Compatibility;
  8. use Shopware\Core\Framework\Context;
  9. use Shopware\Core\Framework\DataAbstractionLayer\EntityDefinition;
  10. use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
  11. use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
  12. use Shopware\Core\Framework\DataAbstractionLayer\Event\EntityWrittenContainerEvent;
  13. use Shopware\Core\Framework\DataAbstractionLayer\Search\AggregationResult\AggregationResultCollection;
  14. use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
  15. use Shopware\Core\Framework\DataAbstractionLayer\Search\EntitySearchResult;
  16. use Shopware\Core\Framework\DataAbstractionLayer\Search\IdSearchResult;
  17. use Shopware\Core\Framework\DataAbstractionLayer\Write\CloneBehavior;
  18. /**
  19.  * @internal
  20.  *
  21.  * required until min version 6.5
  22.  */
  23. if (\interface_exists(EntityRepositoryInterface::class)) {
  24.     // @phpstan-ignore-next-line EntityRepository is final, but we only extend it in 6.4, so we are fine
  25.     class EntityRepositoryDecorator extends EntityRepository implements EntityRepositoryInterface
  26.     {
  27.         private EntityRepositoryInterface $inner;
  28.         public function __construct(EntityRepositoryInterface $inner)
  29.         {
  30.             $this->inner $inner;
  31.         }
  32.         public function getDefinition(): EntityDefinition
  33.         {
  34.             return $this->inner->getDefinition();
  35.         }
  36.         public function search(Criteria $criteriaContext $context): EntitySearchResult
  37.         {
  38.             return $this->inner->search($criteria$context);
  39.         }
  40.         public function aggregate(Criteria $criteriaContext $context): AggregationResultCollection
  41.         {
  42.             return $this->inner->aggregate($criteria$context);
  43.         }
  44.         public function searchIds(Criteria $criteriaContext $context): IdSearchResult
  45.         {
  46.             return $this->inner->searchIds($criteria$context);
  47.         }
  48.         public function update(array $dataContext $context): EntityWrittenContainerEvent
  49.         {
  50.             return $this->inner->update($data$context);
  51.         }
  52.         public function upsert(array $dataContext $context): EntityWrittenContainerEvent
  53.         {
  54.             return $this->inner->upsert($data$context);
  55.         }
  56.         public function create(array $dataContext $context): EntityWrittenContainerEvent
  57.         {
  58.             return $this->inner->create($data$context);
  59.         }
  60.         public function delete(array $idsContext $context): EntityWrittenContainerEvent
  61.         {
  62.             return $this->inner->delete($ids$context);
  63.         }
  64.         public function createVersion(string $idContext $context, ?string $name null, ?string $versionId null): string
  65.         {
  66.             return $this->inner->createVersion($id$context$name$versionId);
  67.         }
  68.         public function merge(string $versionIdContext $context): void
  69.         {
  70.             $this->inner->merge($versionId$context);
  71.         }
  72.         public function clone(string $idContext $context, ?string $newId null, ?CloneBehavior $behavior null): EntityWrittenContainerEvent
  73.         {
  74.             return $this->inner->clone($id$context$newId$behavior);
  75.         }
  76.     }
  77. }