custom/plugins/RHWebCmsElements/src/RHWebCmsElements.php line 12

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace RHWeb\CmsElements;
  3. use RHWeb\CmsElements\Core\PluginHelpers;
  4. use Shopware\Core\Framework\Plugin;
  5. use Symfony\Component\Config\FileLocator;
  6. use Symfony\Component\DependencyInjection\ContainerBuilder;
  7. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  8. use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
  9. class RHWebCmsElements extends Plugin
  10. {
  11.     public function build(ContainerBuilder $container): void
  12.     {
  13.         parent::build($container);
  14.         $loader = new XmlFileLoader($container, new FileLocator(__DIR__ '/Content/DependencyInjection'));
  15.         $loader->load('manufacturer.xml');
  16.         $loader->load('media.xml');
  17.     }
  18.     public function uninstall(UninstallContext $context): void
  19.     {
  20.         parent::uninstall($context);
  21.         if ($context->keepUserData()) {
  22.             return;
  23.         }
  24.         PluginHelpers::removeCmsBlocks($this->container$context->getContext(), [
  25.             'rhweb-brand-slider',
  26.             'rhweb-cta-banner-basic',
  27.             'rhweb-cta-banner-category-five-columns',
  28.             'rhweb-cta-banner-category-four-columns',
  29.             'rhweb-cta-banner-category-three-columns',
  30.             'rhweb-cta-banner-category-two-columns',
  31.             'rhweb-cta-banner-video',
  32.             'rhweb-multi-slider-five',
  33.             'rhweb-multi-slider-four',
  34.             'rhweb-multi-slider-three',
  35.             'rhweb-multi-slider-two',
  36.             'rhweb-service-area-service-area-service-area-four-columns',
  37.             'rhweb-service-area-service-area-service-area-three-columns',
  38.             'rhweb-service-area-service-area-service-area-two-columns',
  39.             'rhweb-service-area-service-area-service-area-one-column',
  40.             'rhweb-testimonial-four-column',
  41.             'rhweb-testimonial-three-column',
  42.             'rhweb-testimonial-two-column',
  43.             'rhweb-testimonial-one-column',
  44.             'rhweb-testimonial-five-slider',
  45.             'rhweb-testimonial-four-slider',
  46.             'rhweb-testimonial-three-slider',
  47.             'rhweb-testimonial-two-slider',
  48.             'rhweb-shop-the-look',
  49.             'rhweb-deal-counter'
  50.         ]);
  51.         PluginHelpers::removeCmsSlots($this->container$context->getContext(), [
  52.             'rhweb-brand-slider',
  53.             'rhweb-cta-banner',
  54.             'rhweb-testimonial',
  55.             'rhweb-shop-the-look',
  56.             'rhweb-deal-counter'
  57.         ]);
  58.     }
  59. }