You are here

public function ContainerBuilder::addResource in Service Container 7

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

Adds a resource for this configuration.

@api

Parameters

ResourceInterface $resource A resource instance:

Return value

ContainerBuilder The current instance

2 calls to ContainerBuilder::addResource()
ContainerBuilder::addClassResource in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerBuilder.php
Adds the given class hierarchy as resources.
ContainerBuilder::merge in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerBuilder.php
Merges a ContainerBuilder with the current ContainerBuilder configuration.

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerBuilder.php, line 213

Class

ContainerBuilder
ContainerBuilder is a DI container that provides an API to easily describe services.

Namespace

Symfony\Component\DependencyInjection

Code

public function addResource(ResourceInterface $resource) {
  if (!$this->trackResources) {
    return $this;
  }
  $this->resources[] = $resource;
  return $this;
}