custom/plugins/WebwirkungPropertySet/src/WebwirkungPropertySet.php line 11

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Webwirkung\PropertySet;
  3. use Doctrine\DBAL\Connection;
  4. use Shopware\Core\Framework\DataAbstractionLayer\Indexing\EntityIndexerRegistry;
  5. use Shopware\Core\Framework\Plugin;
  6. use Shopware\Core\Framework\Plugin\Context\ActivateContext;
  7. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  8. class WebwirkungPropertySet extends Plugin
  9. {
  10.     public function activate(ActivateContext $activateContext): void
  11.     {
  12.         $entityIndexerRegistry $this->container->get(EntityIndexerRegistry::class);
  13.         $entityIndexerRegistry->sendIndexingMessage(['property_group.indexer']);
  14.     }
  15.     public function uninstall(UninstallContext $context): void
  16.     {
  17.         parent::uninstall($context);
  18.         if ($context->keepUserData()) {
  19.             return;
  20.         }
  21.         $connection $this->container->get(Connection::class);
  22.         $connection->executeUpdate('DROP TABLE IF EXISTS `ww_property_set_property_group`');
  23.         $connection->executeUpdate('DROP TABLE IF EXISTS `ww_property_set`');
  24.     }
  25. }