vendor/shopware/core/Framework/DataAbstractionLayer/Indexing/Subscriber/EntityIndexingSubscriber.php line 26

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Framework\DataAbstractionLayer\Indexing\Subscriber;
  3. use Shopware\Core\Framework\DataAbstractionLayer\Event\EntityWrittenContainerEvent;
  4. use Shopware\Core\Framework\DataAbstractionLayer\Indexing\EntityIndexerRegistry;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. /**
  7.  * @internal
  8.  */
  9. class EntityIndexingSubscriber implements EventSubscriberInterface
  10. {
  11.     private EntityIndexerRegistry $indexerRegistry;
  12.     public function __construct(EntityIndexerRegistry $indexerRegistry)
  13.     {
  14.         $this->indexerRegistry $indexerRegistry;
  15.     }
  16.     public static function getSubscribedEvents(): array
  17.     {
  18.         return [EntityWrittenContainerEvent::class => [['refreshIndex'1000]]];
  19.     }
  20.     public function refreshIndex(EntityWrittenContainerEvent $event): void
  21.     {
  22.         $this->indexerRegistry->refresh($event);
  23.     }
  24. }