ModelBundle/DependencyInjection/OpenOrchestraModelExtension.php
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $immutableProperties = array_merge($config['content_immutable_properties'], array('linkedToSite', 'deleted'));
        $container->setParameter('open_orchestra_model.content.immutable_properties', $immutableProperties);

        foreach ($config['fixtures_interface'] as $command => $content) {
            $container->setParameter('open_orchestra_model.fixtures_interface.' . $command, $content);
        }
        $container->setParameter('open_orchestra_model.fixtures.command', array_keys($config['fixtures_interface']));
        foreach ($config['document'] as $class => $content) {
            if (is_array($content)) {
                $container->setParameter('open_orchestra_model.document.' . $class . '.class', $content['class']);
                if (array_key_exists('repository', $content)) {
                    $definition = new Definition($content['repository'], array($content['class']));
                    $definition->setFactory(array(new Reference('doctrine.odm.mongodb.document_manager'), 'getRepository'));
                    $definition->addMethodCall('setAggregationQueryBuilder', array(
                        new Reference('doctrine_mongodb.odm.default_aggregation_query')
                    ));
                    if (method_exists($content['repository'],'setFilterTypeManager')) {
                        $definition->addMethodCall('setFilterTypeManager', array(
                            new Reference('open_orchestra_pagination.filter_type.manager')
                        ));
                    }
                    $container->setDefinition('open_orchestra_model.repository.' . $class, $definition);
                }
            }
        }

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('listener.yml');
        $loader->load('validator.yml');
        $loader->load('manager.yml');
        $loader->load('form.yml');
        $loader->load('transformer.yml');
        $loader->load('helper.yml');
        $loader->load('health_check.yml');
    }
public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $immutableProperties = array_merge($config['content_immutable_properties'], array('linkedToSite', 'deleted'));
        $container->setParameter('open_orchestra_model.content.immutable_properties', $immutableProperties);

        foreach ($config['fixtures_interface'] as $command => $content) {
            $container->setParameter('open_orchestra_model.fixtures_interface.' . $command, $content);
        }
        $container->setParameter('open_orchestra_model.fixtures.command', array_keys($config['fixtures_interface']));
        foreach ($config['document'] as $class => $content) {
            if (is_array($content)) {
                $container->setParameter('open_orchestra_model.document.' . $class . '.class', $content['class']);
                if (array_key_exists('repository', $content)) {
                    $definition = new Definition($content['repository'], array($content['class']));
                    $definition->setFactory(array(new Reference('doctrine.odm.mongodb.document_manager'), 'getRepository'));
                    $definition->addMethodCall('setAggregationQueryBuilder', array(
                        new Reference('doctrine_mongodb.odm.default_aggregation_query')
                    ));
                    if (method_exists($content['repository'],'setFilterTypeManager')) {
                        $definition->addMethodCall('setFilterTypeManager', array(
                            new Reference('open_orchestra_pagination.filter_type.manager')
                        ));
                    }
                    $container->setDefinition('open_orchestra_model.repository.' . $class, $definition);
                }
            }
        }

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('listener.yml');
        $loader->load('validator.yml');
        $loader->load('manager.yml');
        $loader->load('form.yml');
        $loader->load('transformer.yml');
        $loader->load('helper.yml');
        $loader->load('health_check.yml');
    }
public function load ( array $ configs , ContainerBuilder $ container ) { $ configuration = new Configuration ( ) ; $ config = $ this -> processConfiguration ( $ configuration , $ configs ) ; $ immutableProperties = array_merge ( $ config [ 'content_immutable_properties' ] , array ( 'linkedToSite' , 'deleted' ) ) ; $ container -> setParameter ( 'open_orchestra_model.content.immutable_properties' , $ immutableProperties ) ; foreach ( $ config [ 'fixtures_interface' ] as $ command => $ content ) { $ container -> setParameter ( 'open_orchestra_model.fixtures_interface.' . $ command , $ content ) ; } $ container -> setParameter ( 'open_orchestra_model.fixtures.command' , array_keys ( $ config [ 'fixtures_interface' ] ) ) ; foreach ( $ config [ 'document' ] as $ class => $ content ) { if ( is_array ( $ content ) ) { $ container -> setParameter ( 'open_orchestra_model.document.' . $ class . '.class' , $ content [ 'class' ] ) ; if ( array_key_exists ( 'repository' , $ content ) ) { $ definition = new Definition ( $ content [ 'repository' ] , array ( $ content [ 'class' ] ) ) ; $ definition -> setFactory ( array ( new Reference ( 'doctrine.odm.mongodb.document_manager' ) , 'getRepository' ) ) ; $ definition -> addMethodCall ( 'setAggregationQueryBuilder' , array ( new Reference ( 'doctrine_mongodb.odm.default_aggregation_query' ) ) ) ; if ( method_exists ( $ content [ 'repository' ] , 'setFilterTypeManager' ) ) { $ definition -> addMethodCall ( 'setFilterTypeManager' , array ( new Reference ( 'open_orchestra_pagination.filter_type.manager' ) ) ) ; } $ container -> setDefinition ( 'open_orchestra_model.repository.' . $ class , $ definition ) ; } } } $ loader = new Loader \ YamlFileLoader ( $ container , new FileLocator ( __DIR__ . '/../Resources/config' ) ) ; $ loader -> load ( 'listener.yml' ) ; $ loader -> load ( 'validator.yml' ) ; $ loader -> load ( 'manager.yml' ) ; $ loader -> load ( 'form.yml' ) ; $ loader -> load ( 'transformer.yml' ) ; $ loader -> load ( 'helper.yml' ) ; $ loader -> load ( 'health_check.yml' ) ; }
{@inheritDoc}
{