vendor/store.shopware.com/h1webblog/src/H1webBlog.php line 10

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace H1web\Blog;
  3. use Shopware\Core\Framework\Plugin;
  4. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  5. use Doctrine\DBAL\Connection;
  6. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  7. class H1webBlog extends Plugin
  8. {
  9.     public function uninstall(UninstallContext $context): void
  10.     {
  11.         parent::uninstall($context);
  12.         if ($context->keepUserData()) {
  13.             return;
  14.         }
  15.         $connection $this->container->get(Connection::class);
  16.         $connection->query('DROP TABLE IF EXISTS `h1webblog_blog_visibility`');
  17.         $connection->query('DROP TABLE IF EXISTS `h1webblog_blog_search_keyword`');
  18.         $connection->query('DROP TABLE IF EXISTS `h1webblog_blog_keyword_dictionary`');
  19.         $connection->query('DROP TABLE IF EXISTS `h1webblog_blog_translation`');
  20.         $connection->query('DROP TABLE IF EXISTS `h1webblog_option`');
  21.         $connection->query('DROP TABLE IF EXISTS `h1webblog_property`');
  22.         $connection->query('DROP TABLE IF EXISTS `h1webblog_tag`');
  23.         $connection->query('DROP TABLE IF EXISTS `h1webblog_category_tree`');
  24.         $connection->query('DROP TABLE IF EXISTS `h1webblog_category`');
  25.         $connection->query('DROP TABLE IF EXISTS `h1webblog_blog`');
  26.         $connection->query('DELETE FROM `seo_url_template` WHERE `route_name` LIKE "frontend.h1webblog.blog"');
  27.         $connection->query('DELETE FROM `media_default_folder` WHERE `entity` = "h1webblog_blog"');
  28.         $connection->query('DELETE FROM `media_folder` WHERE `name` = "Blog Media"');
  29.     }
  30. }