You are here

private function XmlFileLoader::parseDefinitions in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php \Symfony\Component\DependencyInjection\Loader\XmlFileLoader::parseDefinitions()

Parses multiple definitions.

Parameters

\DOMDocument $xml:

string $file:

1 call to XmlFileLoader::parseDefinitions()
XmlFileLoader::load in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php, line 109

Class

XmlFileLoader
XmlFileLoader loads XML files service definitions.

Namespace

Symfony\Component\DependencyInjection\Loader

Code

private function parseDefinitions(\DOMDocument $xml, $file) {
  $xpath = new \DOMXPath($xml);
  $xpath
    ->registerNamespace('container', self::NS);
  if (false === ($services = $xpath
    ->query('//container:services/container:service'))) {
    return;
  }
  foreach ($services as $service) {
    if (null !== ($definition = $this
      ->parseDefinition($service, $file))) {
      $this->container
        ->setDefinition((string) $service
        ->getAttribute('id'), $definition);
    }
  }
}