/**
  * @return ArrayNodeDefinition
  */
 private function createResourceNodes()
 {
     $resourcesNode = $this->createNode('resources')->addDefaultsIfNotSet();
     $childrenNode = $resourcesNode->children();
     foreach ($this->bundle->getResources() as $resource) {
         $childrenNode->append($this->createResourceNode($resource));
     }
     return $resourcesNode;
 }
Exemple #2
0
 /**
  * {@inheritdoc}
  */
 protected function loadInternal(array $config, ContainerBuilder $container)
 {
     foreach ($this->bundle->getResources() as $resource) {
         $resourceConfig = $config['resources'][$resource->getName()];
         $this->configureResource($resource, $resourceConfig);
         $this->loadResource($resource, $container);
         foreach ($resource->getRelations() as $name => $relation) {
             $this->configureResource($relation, $resourceConfig[$name]);
             $this->loadResource($relation, $container);
         }
     }
     $this->loadBundle($config, $container);
 }
Exemple #3
0
 /**
  * {@inheritdoc}
  */
 protected function loadInternal(array $config, ContainerBuilder $container)
 {
     foreach ($this->bundle->getResources() as $resource) {
         $resourceConfig = $config['resources'][$resource->getName()];
         $this->configureResource($resource, $resourceConfig);
         $this->loadResource($resource, $container);
         if ($resource->getTranslation() !== null) {
             $this->configureResource($resource->getTranslation(), $resourceConfig['translation']);
             $this->loadResource($resource->getTranslation(), $container);
         }
     }
     $this->loadBundle($config, $container);
 }