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

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Biloba\IntlTranslation;
  3. use Doctrine\DBAL\Connection;
  4. use Shopware\Core\Framework\Plugin;
  5. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  6. class BilobaIntlTranslation extends Plugin
  7. {
  8.     public function uninstall(UninstallContext $context): void
  9.     {
  10.         parent::uninstall($context);
  11.         $connection $this->container->get(Connection::class);
  12.         
  13.         // Delete all translations when uninstalling the plugin
  14.         $connection->exec('DELETE `product_translation` FROM `product_translation` LEFT JOIN `biloba_intl_translation_log` ON `biloba_intl_translation_log`.`entity_id` = `product_translation`.`product_id`
  15.         WHERE `biloba_intl_translation_log`.`target_language_id` = `product_translation`.`language_id`');
  16.         $connection->exec('DROP TABLE IF EXISTS `biloba_intl_translation_config`');
  17.         $connection->exec('DROP TABLE IF EXISTS `biloba_intl_translation_log`');
  18.     }
  19. }