src/Sylius/Bundle/AttributeBundle/SyliusAttributeBundle.php line 22

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Sylius package.
  4.  *
  5.  * (c) Paweł Jędrzejewski
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. declare(strict_types=1);
  11. namespace Sylius\Bundle\AttributeBundle;
  12. use Sylius\Bundle\AttributeBundle\DependencyInjection\Compiler\RegisterAttributeFactoryPass;
  13. use Sylius\Bundle\AttributeBundle\DependencyInjection\Compiler\RegisterAttributeTypePass;
  14. use Sylius\Bundle\ResourceBundle\AbstractResourceBundle;
  15. use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;
  16. use Symfony\Component\DependencyInjection\ContainerBuilder;
  17. final class SyliusAttributeBundle extends AbstractResourceBundle
  18. {
  19.     /**
  20.      * {@inheritdoc}
  21.      */
  22.     public function getSupportedDrivers(): array
  23.     {
  24.         return [
  25.             SyliusResourceBundle::DRIVER_DOCTRINE_ORM,
  26.         ];
  27.     }
  28.     /**
  29.      * {@inheritdoc}
  30.      */
  31.     public function build(ContainerBuilder $container): void
  32.     {
  33.         parent::build($container);
  34.         $container->addCompilerPass(new RegisterAttributeTypePass());
  35.         $container->addCompilerPass(new RegisterAttributeFactoryPass());
  36.     }
  37.     /**
  38.      * {@inheritdoc}
  39.      */
  40.     protected function getModelNamespace(): string
  41.     {
  42.         return 'Sylius\Component\Attribute\Model';
  43.     }
  44. }