custom/plugins/EsmFilter/src/EsmFilter.php line 10

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace EsmFilter;
  3. use Shopware\Core\Framework\DataAbstractionLayer\Indexing\EntityIndexerRegistry;
  4. use Shopware\Core\Framework\Plugin;
  5. use Shopware\Core\Framework\Plugin\Context\ActivateContext;
  6. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  7. class EsmFilter extends Plugin
  8. {
  9.     public function activate(ActivateContext $activateContext): void
  10.     {
  11.         $registry $this->container->get(EntityIndexerRegistry::class);
  12.         if($registry) {
  13.             $registry->sendIndexingMessage(['category.indexer']);
  14.         }
  15.     }
  16.     public function uninstall(UninstallContext $uninstallContext): void
  17.     {
  18.         parent::uninstall($uninstallContext);
  19.         if($uninstallContext->keepUserData()){
  20.             return;
  21.         }
  22.     }
  23. }