custom/plugins/NetiNextEasyCouponDesigns/src/Decorator/EasyCouponProductRepositoryDecorator.php line 40

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace NetInventors\NetiNextEasyCouponDesigns\Decorator;
  4. use Shopware\Core\Framework\DataAbstractionLayer\Search\AggregationResult\AggregationResultCollection;
  5. use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
  6. use Shopware\Core\Framework\DataAbstractionLayer\Search\EntitySearchResult;
  7. use Shopware\Core\Framework\DataAbstractionLayer\Search\IdSearchResult;
  8. use Shopware\Core\System\SalesChannel\Entity\SalesChannelRepositoryInterface;
  9. use Shopware\Core\System\SalesChannel\SalesChannelContext;
  10. class EasyCouponProductRepositoryDecorator implements SalesChannelRepositoryInterface
  11. {
  12.     protected SalesChannelRepositoryInterface $repository;
  13.     public function __construct(
  14.         SalesChannelRepositoryInterface $repository
  15.     ) {
  16.         $this->repository $repository;
  17.     }
  18.     public function aggregate(Criteria $criteriaSalesChannelContext $salesChannelContext): AggregationResultCollection
  19.     {
  20.         return $this->repository->aggregate($criteria$salesChannelContext);
  21.     }
  22.     public function searchIds(Criteria $criteriaSalesChannelContext $salesChannelContext): IdSearchResult
  23.     {
  24.         return $this->repository->searchIds($criteria$salesChannelContext);
  25.     }
  26.     public function search(Criteria $criteriaSalesChannelContext $salesChannelContext): EntitySearchResult
  27.     {
  28.         $criteria->addAssociation('netiEasyCouponProduct.netiEasyCouponDesigns.variants.types');
  29.         $criteria->addAssociation('netiEasyCouponProduct.netiEasyCouponDesigns.variants.pages');
  30.         $criteria->addAssociation('netiEasyCouponProduct.netiEasyCouponDesigns.variants.translations.media.thumbnails');
  31.         $result $this->repository->search($criteria$salesChannelContext);
  32.         return $result;
  33.     }
  34. }