vendor/crehler/additional-article-mb/src/CrehlerAdditionalArticle.php line 22

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. /**
  3.  * @support Crehler <support@crehler.com>
  4.  * @copyright Crehler Sp. z o. o.
  5.  * @version: 1.0
  6.  */
  7. namespace Crehler\AdditionalArticle;
  8. use Doctrine\DBAL\Connection;
  9. use Shopware\Core\Framework\Plugin;
  10. use Shopware\Core\Framework\Plugin\Context\{
  11.     ActivateContext,
  12.     UninstallContext
  13. };
  14. /**
  15.  * Class AdditionalArticle
  16.  * @package Crehler\AdditionalArticle
  17.  */
  18. class CrehlerAdditionalArticle extends Plugin
  19. {
  20.     /**
  21.      * @param ActivateContext $activateContext
  22.      * @throws \Exception
  23.      */
  24.     public function activate(ActivateContext $activateContext): void
  25.     {
  26.     }
  27.     /**
  28.      * @param UninstallContext $context
  29.      */
  30.     public function uninstall(UninstallContext $context): void
  31.     {
  32.         parent::uninstall($context);
  33.         if ($context->keepUserData()) {
  34.             return;
  35.         }
  36.         $connection $this->container->get(Connection::class);
  37.         $connection->executeUpdate('DROP TABLE IF EXISTS `additional_products`');
  38.         $connection->executeUpdate('ALTER TABLE `product` DROP COLUMN `additional_set_product_stream_id`');
  39.     }
  40. }