<?php declare(strict_types=1);
namespace Webwirkung\PropertySet;
use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\DataAbstractionLayer\Indexing\EntityIndexerRegistry;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\ActivateContext;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
class WebwirkungPropertySet extends Plugin
{
public function activate(ActivateContext $activateContext): void
{
$entityIndexerRegistry = $this->container->get(EntityIndexerRegistry::class);
$entityIndexerRegistry->sendIndexingMessage(['property_group.indexer']);
}
public function uninstall(UninstallContext $context): void
{
parent::uninstall($context);
if ($context->keepUserData()) {
return;
}
$connection = $this->container->get(Connection::class);
$connection->executeUpdate('DROP TABLE IF EXISTS `ww_property_set_property_group`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ww_property_set`');
}
}