custom/static-plugins/NdVoorwindenTheme/src/Subscriber/AdditionalImageCriteria.php line 17

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Nd\Voorwinden\Subscriber;
  3. use Shopware\Storefront\Page\Product\ProductPageCriteriaEvent;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. class AdditionalImageCriteria implements EventSubscriberInterface
  6. {
  7.     public static function getSubscribedEvents(): array
  8.     {
  9.         return [
  10.             ProductPageCriteriaEvent::class => 'onProductCriteriaLoaded'
  11.         ];
  12.     }
  13.     public function onProductCriteriaLoaded(ProductPageCriteriaEvent $event): void
  14.     {
  15.         $event->getCriteria()->getAssociation('secondMediaExtension.media');
  16.     }
  17. }