vendor/coreshop/core-shop/src/CoreShop/Bundle/ShippingBundle/CoreShopShippingBundle.php line 35

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4.  * CoreShop
  5.  *
  6.  * This source file is available under two different licenses:
  7.  *  - GNU General Public License version 3 (GPLv3)
  8.  *  - CoreShop Commercial License (CCL)
  9.  * Full copyright and license information is available in
  10.  * LICENSE.md which is distributed with this source code.
  11.  *
  12.  * @copyright  Copyright (c) CoreShop GmbH (https://www.coreshop.org)
  13.  * @license    https://www.coreshop.org/license     GPLv3 and CCL
  14.  *
  15.  */
  16. namespace CoreShop\Bundle\ShippingBundle;
  17. use CoreShop\Bundle\AddressBundle\CoreShopAddressBundle;
  18. use CoreShop\Bundle\CurrencyBundle\CoreShopCurrencyBundle;
  19. use CoreShop\Bundle\MoneyBundle\CoreShopMoneyBundle;
  20. use CoreShop\Bundle\ResourceBundle\AbstractResourceBundle;
  21. use CoreShop\Bundle\ResourceBundle\CoreShopResourceBundle;
  22. use CoreShop\Bundle\RuleBundle\CoreShopRuleBundle;
  23. use CoreShop\Bundle\ShippingBundle\DependencyInjection\Compiler\CompositeShippableValidatorPass;
  24. use CoreShop\Bundle\ShippingBundle\DependencyInjection\Compiler\ShippingPriceCalculatorsPass;
  25. use CoreShop\Bundle\ShippingBundle\DependencyInjection\Compiler\ShippingRuleActionPass;
  26. use CoreShop\Bundle\ShippingBundle\DependencyInjection\Compiler\ShippingRuleConditionPass;
  27. use CoreShop\Bundle\ShippingBundle\DependencyInjection\Compiler\ShippingTaxCalculationStrategyPass;
  28. use Pimcore\HttpKernel\BundleCollection\BundleCollection;
  29. use Symfony\Component\DependencyInjection\ContainerBuilder;
  30. final class CoreShopShippingBundle extends AbstractResourceBundle
  31. {
  32.     public function getSupportedDrivers(): array
  33.     {
  34.         return [
  35.             CoreShopResourceBundle::DRIVER_DOCTRINE_ORM,
  36.         ];
  37.     }
  38.     public function build(ContainerBuilder $container): void
  39.     {
  40.         parent::build($container);
  41.         $container->addCompilerPass(new ShippingRuleConditionPass());
  42.         $container->addCompilerPass(new ShippingRuleActionPass());
  43.         $container->addCompilerPass(new ShippingPriceCalculatorsPass());
  44.         $container->addCompilerPass(new CompositeShippableValidatorPass());
  45.         $container->addCompilerPass(new ShippingTaxCalculationStrategyPass());
  46.     }
  47.     public static function registerDependentBundles(BundleCollection $collection): void
  48.     {
  49.         parent::registerDependentBundles($collection);
  50.         $collection->addBundle(new CoreShopAddressBundle(), 2800);
  51.         $collection->addBundle(new CoreShopRuleBundle(), 3500);
  52.         $collection->addBundle(new CoreShopMoneyBundle(), 3600);
  53.         $collection->addBundle(new CoreShopCurrencyBundle(), 2700);
  54.     }
  55.     protected function getModelNamespace(): string
  56.     {
  57.         return 'CoreShop\Component\Shipping\Model';
  58.     }
  59. }