You are here

public function ContainerBuilder::addObjectResource 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::addObjectResource()

Adds the object class hierarchy as resources.

@api

Parameters

object $object An object instance:

Return value

ContainerBuilder The current instance

2 calls to ContainerBuilder::addObjectResource()
ContainerBuilder::addCompilerPass in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerBuilder.php
Adds a compiler pass.
ContainerBuilder::compile in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerBuilder.php
Compiles the container.

File

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

Class

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

Namespace

Symfony\Component\DependencyInjection

Code

public function addObjectResource($object) {
  if ($this->trackResources) {
    $this
      ->addClassResource(new \ReflectionClass($object));
  }
  return $this;
}