custom/plugins/NetzpShopmanager6/src/NetzpShopmanager6.php line 14

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace NetzpShopmanager6;
  3. use NetzpShopmanager6\Components\Installer;
  4. use NetzpShopmanager6\Components\Uninstaller;
  5. use Shopware\Core\Framework\Plugin;
  6. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  7. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  8. use Symfony\Component\Config\FileLocator;
  9. use Symfony\Component\DependencyInjection\ContainerBuilder;
  10. use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
  11. class NetzpShopmanager6 extends Plugin
  12. {
  13.     public function install(InstallContext $context): void
  14.     {
  15.         parent::install($context);
  16.         (new Installer($this->container))->install();
  17.     }
  18.     public function uninstall(UninstallContext $context): void
  19.     {
  20.         parent::uninstall($context);
  21.         $this->removeMigrations();
  22.         (new Uninstaller($this->container))->uninstall($context);
  23.     }
  24.     public function build(ContainerBuilder $container): void
  25.     {
  26.         parent::build($container);
  27.         // inject flow builder >= SW 6.4.6.0
  28.         if (version_compare($container->getParameter('kernel.shopware_version'), '6.4.6.0''>=')) {
  29.             $loader = new XmlFileLoader($container, new FileLocator(__DIR__ '/Resources/config'));
  30.             $loader->load('services_flowbuilder.xml');
  31.         }
  32.     }
  33. }