custom/plugins/SwagPayPal/src/Util/Compatibility/SalesChannelRepositoryDecorator.php line 39

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\DataAbstractionLayer\Search\AggregationResult\AggregationResultCollection;
  9. use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
  10. use Shopware\Core\Framework\DataAbstractionLayer\Search\EntitySearchResult;
  11. use Shopware\Core\Framework\DataAbstractionLayer\Search\IdSearchResult;
  12. use Shopware\Core\System\SalesChannel\Entity\SalesChannelRepository;
  13. use Shopware\Core\System\SalesChannel\Entity\SalesChannelRepositoryInterface;
  14. use Shopware\Core\System\SalesChannel\SalesChannelContext;
  15. /**
  16.  * @internal
  17.  *
  18.  * required until min version 6.5
  19.  */
  20. if (\interface_exists(SalesChannelRepositoryInterface::class)) {
  21.     // @phpstan-ignore-next-line SalesChannelRepository is final, but we only extend it in 6.4, so we are fine
  22.     class SalesChannelRepositoryDecorator extends SalesChannelRepository implements SalesChannelRepositoryInterface
  23.     {
  24.         private SalesChannelRepositoryInterface $inner;
  25.         public function __construct(SalesChannelRepositoryInterface $inner)
  26.         {
  27.             $this->inner $inner;
  28.         }
  29.         public function search(Criteria $criteriaSalesChannelContext $context): EntitySearchResult
  30.         {
  31.             return $this->inner->search($criteria$context);
  32.         }
  33.         public function aggregate(Criteria $criteriaSalesChannelContext $context): AggregationResultCollection
  34.         {
  35.             return $this->inner->aggregate($criteria$context);
  36.         }
  37.         public function searchIds(Criteria $criteriaSalesChannelContext $context): IdSearchResult
  38.         {
  39.             return $this->inner->searchIds($criteria$context);
  40.         }
  41.     }
  42. }