<?php declare(strict_types=1);
namespace ApplifactionGuidedShopping;
use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
class ApplifactionGuidedShopping extends Plugin
{
public function uninstall(UninstallContext $uninstallContext): void
{
parent::uninstall($uninstallContext);
if ($uninstallContext->keepUserData()) {
return;
}
$this->dropTables();
}
private function dropTables(): void
{
$connection = $this->container->get(Connection::class);
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_property_group_option_value`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_dynamic_filter_rule`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_accessory_rule_accessory_excluded_option`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_accessory_rule_accessory_included_option`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_accessory_rule_accessory_product_stream`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_accessory_rule_main_product_excluded_option`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_accessory_rule_main_product_included_option`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_accessory_rule_main_product_stream`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_accessory_rule_translation`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_accessory_rule`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_product_finder_step_option`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_product_finder_step_stream`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_property_group_option_extension_translation`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_property_group_option_extension`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_product_stream_extension_translation`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_product_stream_extension`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_product_finder_step_translation`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_product_finder_step`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_product_finder_translation`');
$connection->executeUpdate('DROP TABLE IF EXISTS `ags_product_finder`');
}
}