public function load(array $configs, ContainerBuilder $container)
    {
        $processor = new Processor();
        $configuration = new Configuration();
        $config = $processor->processConfiguration($configuration, $configs);
        $bundles = $container->getParameter('kernel.bundles');

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('block.xml');
        $loader->load('product.xml');
        $loader->load('orm.xml');
        $loader->load('form.xml');
        $loader->load('twig.xml');
        $loader->load('menu.xml');
        $loader->load('serializer.xml');

        if (isset($bundles['FOSRestBundle'], $bundles['NelmioApiDocBundle'])) {
            $loader->load('api_controllers.xml');
            $loader->load('api_form.xml');
        }

        if (isset($bundles['SonataAdminBundle'])) {
            $loader->load('admin.xml');
        }

        $pool = $container->getDefinition('sonata.product.pool');
        // this value is altered by the AddProductProviderPass class
        $pool->addMethodCall('__hack', $config['products']);

        $this->registerParameters($container, $config);
        $this->registerDoctrineMapping($config);
        $this->registerSeoParameters($container, $config);
    }
public function load(array $configs, ContainerBuilder $container)
    {
        $processor = new Processor();
        $configuration = new Configuration();
        $config = $processor->processConfiguration($configuration, $configs);
        $bundles = $container->getParameter('kernel.bundles');

        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('block.xml');
        $loader->load('product.xml');
        $loader->load('orm.xml');
        $loader->load('form.xml');
        $loader->load('twig.xml');
        $loader->load('menu.xml');
        $loader->load('serializer.xml');

        if (isset($bundles['FOSRestBundle'], $bundles['NelmioApiDocBundle'])) {
            $loader->load('api_controllers.xml');
            $loader->load('api_form.xml');
        }

        if (isset($bundles['SonataAdminBundle'])) {
            $loader->load('admin.xml');
        }

        $pool = $container->getDefinition('sonata.product.pool');
        // this value is altered by the AddProductProviderPass class
        $pool->addMethodCall('__hack', $config['products']);

        $this->registerParameters($container, $config);
        $this->registerDoctrineMapping($config);
        $this->registerSeoParameters($container, $config);
    }
public function load ( array $ configs , ContainerBuilder $ container ) { $ processor = new Processor ( ) ; $ configuration = new Configuration ( ) ; $ config = $ processor -> processConfiguration ( $ configuration , $ configs ) ; $ bundles = $ container -> getParameter ( 'kernel.bundles' ) ; $ loader = new XmlFileLoader ( $ container , new FileLocator ( __DIR__ . '/../Resources/config' ) ) ; $ loader -> load ( 'block.xml' ) ; $ loader -> load ( 'product.xml' ) ; $ loader -> load ( 'orm.xml' ) ; $ loader -> load ( 'form.xml' ) ; $ loader -> load ( 'twig.xml' ) ; $ loader -> load ( 'menu.xml' ) ; $ loader -> load ( 'serializer.xml' ) ; if ( isset ( $ bundles [ 'FOSRestBundle' ] , $ bundles [ 'NelmioApiDocBundle' ] ) ) { $ loader -> load ( 'api_controllers.xml' ) ; $ loader -> load ( 'api_form.xml' ) ; } if ( isset ( $ bundles [ 'SonataAdminBundle' ] ) ) { $ loader -> load ( 'admin.xml' ) ; } $ pool = $ container -> getDefinition ( 'sonata.product.pool' ) ; // this value is altered by the AddProductProviderPass class $ pool -> addMethodCall ( '__hack' , $ config [ 'products' ] ) ; $ this -> registerParameters ( $ container , $ config ) ; $ this -> registerDoctrineMapping ( $ config ) ; $ this -> registerSeoParameters ( $ container , $ config ) ; }
Loads the product configuration.

@param array            $configs   An array of configuration settings
@param ContainerBuilder $container A ContainerBuilder instance
Loads the product configuration .