<?php
/**
* Copyright(c) 2024 SYSTEM_KD
* Date: 2024/06/08
*/
namespace Plugin\QuantityDiscountDx\Bundle;
use Eccube\Common\Constant;
use Plugin\QuantityDiscountDx\DependencyInjection\Compiler\PurchaseFlowPassEx;
use Plugin\QuantityDiscountDx\DependencyInjection\Compiler\PurchaseFlowPassEx43;
use Plugin\QuantityDiscountDx\DependencyInjection\Compiler\ServiceLocatorPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class QuantityDiscountDxBundle extends Bundle
{
public function build(ContainerBuilder $container): void
{
parent::build($container);
// Migrationで利用するService追加
$container->addCompilerPass(new ServiceLocatorPass());
// PurchaseFlow変更
if (version_compare(Constant::VERSION, '4.3', '>=')) {
// 4.3系の場合
$container->addCompilerPass(new PurchaseFlowPassEx43());
} else {
// 4.2系の場合
$container->addCompilerPass(new PurchaseFlowPassEx());
}
}
}