app/Plugin/QuantityDiscountDx/Bundle/QuantityDiscountDxBundle.php line 17

Open in your IDE?
  1. <?php
  2. /**
  3.  * Copyright(c) 2024 SYSTEM_KD
  4.  * Date: 2024/06/08
  5.  */
  6. namespace Plugin\QuantityDiscountDx\Bundle;
  7. use Eccube\Common\Constant;
  8. use Plugin\QuantityDiscountDx\DependencyInjection\Compiler\PurchaseFlowPassEx;
  9. use Plugin\QuantityDiscountDx\DependencyInjection\Compiler\PurchaseFlowPassEx43;
  10. use Plugin\QuantityDiscountDx\DependencyInjection\Compiler\ServiceLocatorPass;
  11. use Symfony\Component\DependencyInjection\ContainerBuilder;
  12. use Symfony\Component\HttpKernel\Bundle\Bundle;
  13. class QuantityDiscountDxBundle extends Bundle
  14. {
  15.     public function build(ContainerBuilder $container): void
  16.     {
  17.         parent::build($container);
  18.         // Migrationで利用するService追加
  19.         $container->addCompilerPass(new ServiceLocatorPass());
  20.         // PurchaseFlow変更
  21.         if (version_compare(Constant::VERSION'4.3''>=')) {
  22.             // 4.3系の場合
  23.             $container->addCompilerPass(new PurchaseFlowPassEx43());
  24.         } else {
  25.             // 4.2系の場合
  26.             $container->addCompilerPass(new PurchaseFlowPassEx());
  27.         }
  28.     }
  29. }