custom/plugins/DtgsGoogleTagManagerSw6/src/DtgsGoogleTagManagerSw6.php line 13

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Dtgs\GoogleTagManager;
  3. use Shopware\Core\Framework\Plugin;
  4. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  5. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  6. use Symfony\Component\Config\FileLocator;
  7. use Symfony\Component\DependencyInjection\ContainerBuilder;
  8. use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
  9. class DtgsGoogleTagManagerSw6 extends Plugin
  10. {
  11.     /**
  12.      * {@inheritdoc}
  13.      */
  14.     public function build(ContainerBuilder $container): void
  15.     {
  16.         parent::build($container);
  17.         $loader = new XmlFileLoader($container, new FileLocator(__DIR__ '/DependencyInjection/'));
  18.         $loader->load('helper.xml');
  19.         $loader->load('gtm_services.xml');
  20.         $loader->load('subscriber.xml');
  21.     }
  22.     /**
  23.      * @param InstallContext $context
  24.      */
  25.     public function install(InstallContext $context): void
  26.     {
  27.         parent::install($context);
  28.     }
  29.     /**
  30.      * @param UninstallContext $context
  31.      */
  32.     public function uninstall(UninstallContext $context): void
  33.     {
  34.         parent::uninstall($context);
  35.         if ($context->keepUserData()) {
  36.             return;
  37.         }
  38.     }
  39. }