vendor/ibexa/corporate-account/src/bundle/IbexaCorporateAccountBundle.php line 19

Open in your IDE?
  1. <?php
  2. /**
  3. * @copyright Copyright (C) Ibexa AS. All rights reserved.
  4. * @license For full copyright and license information view LICENSE file distributed with this source code.
  5. */
  6. declare(strict_types=1);
  7. namespace Ibexa\Bundle\CorporateAccount;
  8. use Ibexa\Bundle\CorporateAccount\DependencyInjection\Compiler\AdminUiFormCompilerPass;
  9. use Ibexa\Bundle\CorporateAccount\DependencyInjection\Configuration\Parser\CorporateAccounts;
  10. use Ibexa\CorporateAccount\Permission\Policy\PolicyProvider;
  11. use Symfony\Component\Config\FileLocator;
  12. use Symfony\Component\DependencyInjection\ContainerBuilder;
  13. use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
  14. use Symfony\Component\HttpKernel\Bundle\Bundle;
  15. final class IbexaCorporateAccountBundle extends Bundle
  16. {
  17. public const CUSTOMER_PORTAL_GROUP_NAME = 'corporate_group';
  18. public function build(ContainerBuilder $container): void
  19. {
  20. parent::build($container);
  21. $loader = new YamlFileLoader(
  22. $container,
  23. new FileLocator(__DIR__ . '/Resources/config')
  24. );
  25. if ($container->hasExtension('ibexa_commerce_eshop')) {
  26. $loader->load('services/commerce_bridge.yaml');
  27. }
  28. if ($container->hasExtension('ibexa_cdp')) {
  29. $loader->load('services/cdp/item_processors.yaml');
  30. }
  31. /** @var \Ibexa\Bundle\Core\DependencyInjection\IbexaCoreExtension $kernelExtension */
  32. $kernelExtension = $container->getExtension('ibexa');
  33. $kernelExtension->addConfigParser(new CorporateAccounts());
  34. $kernelExtension->addDefaultSettings(__DIR__ . '/Resources/config', ['default_settings.yaml']);
  35. $kernelExtension->addPolicyProvider(new PolicyProvider());
  36. $container->addCompilerPass(new AdminUiFormCompilerPass());
  37. }
  38. }