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

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 Shopware\Core\Framework\Log\Package;
  6. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  7. /**
  8.  * @internal
  9.  */
  10. #[Package('core')]
  11. class EntityIndexingSubscriber implements EventSubscriberInterface
  12. {
  13.     private EntityIndexerRegistry $indexerRegistry;
  14.     public function __construct(EntityIndexerRegistry $indexerRegistry)
  15.     {
  16.         $this->indexerRegistry $indexerRegistry;
  17.     }
  18.     public static function getSubscribedEvents(): array
  19.     {
  20.         return [EntityWrittenContainerEvent::class => [['refreshIndex'1000]]];
  21.     }
  22.     public function refreshIndex(EntityWrittenContainerEvent $event): void
  23.     {
  24.         $this->indexerRegistry->refresh($event);
  25.     }
  26. }