custom/plugins/BilobaIntlTranslationDictionary/src/BilobaIntlTranslationDictionary.php line 9

Open in your IDE?
  1. <?php
  2. namespace Biloba\IntlTranslationDictionary;
  3. use Shopware\Core\Framework\Plugin;
  4. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  5. use Doctrine\DBAL\Connection;
  6. class BilobaIntlTranslationDictionary extends Plugin
  7. {
  8.     public function uninstall(UninstallContext $context): void
  9.     {
  10.         parent::uninstall($context);
  11.         if ($context->keepUserData()) {
  12.             return;
  13.         }
  14.         $connection $this->container->get(Connection::class);
  15.         
  16.         // Delete all translations when uninstalling the plugin
  17.         $connection->exec('DROP TABLE IF EXISTS `biloba_intl_translation_dictionary_entry_translation`');
  18.         $connection->exec('DROP TABLE IF EXISTS `biloba_intl_translation_dictionary_entry`');
  19.     }
  20. }