[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/symfony/dependency-injection/ -> ContainerBuilder.php (summary)

(no description)

File Size: 1195 lines (37 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ContainerBuilder:: (57 methods):
  __construct()
  setResourceTracking()
  isTrackingResources()
  setProxyInstantiator()
  registerExtension()
  getExtension()
  getExtensions()
  hasExtension()
  getResources()
  addResource()
  setResources()
  addObjectResource()
  addClassResource()
  loadFromExtension()
  addCompilerPass()
  getCompilerPassConfig()
  getCompiler()
  getScopes()
  getScopeChildren()
  set()
  removeDefinition()
  has()
  get()
  merge()
  getExtensionConfig()
  prependExtensionConfig()
  compile()
  getServiceIds()
  addAliases()
  setAliases()
  setAlias()
  removeAlias()
  hasAlias()
  getAliases()
  getAlias()
  register()
  addDefinitions()
  setDefinitions()
  getDefinitions()
  setDefinition()
  hasDefinition()
  getDefinition()
  findDefinition()
  createService()
  resolveServices()
  doResolveServices()
  findTaggedServiceIds()
  findTags()
  findUnusedTags()
  addExpressionLanguageProvider()
  getExpressionLanguageProviders()
  getServiceConditionals()
  getProxyInstantiator()
  synchronize()
  callMethod()
  shareService()
  getExpressionLanguage()


Class: ContainerBuilder  - X-Ref

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

__construct(ParameterBagInterface $parameterBag = null)   X-Ref


setResourceTracking($track)   X-Ref
Sets the track resources flag.

If you are not using the loaders and therefore don't want
to depend on the Config component, set this flag to false.

param: bool $track True if you want to track resources, false otherwise

isTrackingResources()   X-Ref
Checks if resources are tracked.

return: bool true If resources are tracked, false otherwise

setProxyInstantiator(InstantiatorInterface $proxyInstantiator)   X-Ref
Sets the instantiator to be used when fetching proxies.


registerExtension(ExtensionInterface $extension)   X-Ref
No description

getExtension($name)   X-Ref
Returns an extension by alias or namespace.

param: string $name An alias or a namespace
return: ExtensionInterface An extension instance

getExtensions()   X-Ref
Returns all registered extensions.

return: ExtensionInterface[] An array of ExtensionInterface

hasExtension($name)   X-Ref
Checks if we have an extension.

param: string $name The name of the extension
return: bool If the extension exists

getResources()   X-Ref
Returns an array of resources loaded to build this configuration.

return: ResourceInterface[] An array of resources

addResource(ResourceInterface $resource)   X-Ref

return: $this

setResources(array $resources)   X-Ref
Sets the resources for this configuration.

param: ResourceInterface[] $resources An array of resources
return: $this

addObjectResource($object)   X-Ref
Adds the object class hierarchy as resources.

param: object $object An object instance
return: $this

addClassResource(\ReflectionClass $class)   X-Ref
Adds the given class hierarchy as resources.

return: $this

loadFromExtension($extension, array $values = null)   X-Ref
Loads the configuration for an extension.

param: string $extension The extension alias or namespace
param: array  $values    An array of values that customizes the extension
return: $this

addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION)   X-Ref
Adds a compiler pass.

param: CompilerPassInterface $pass A compiler pass
param: string                $type The type of compiler pass
return: $this

getCompilerPassConfig()   X-Ref
Returns the compiler pass config which can then be modified.

return: PassConfig The compiler pass config

getCompiler()   X-Ref
Returns the compiler.

return: Compiler The compiler

getScopes($triggerDeprecationError = true)   X-Ref
Returns all Scopes.

return: array An array of scopes

getScopeChildren($triggerDeprecationError = true)   X-Ref
Returns all Scope children.

return: array An array of scope children

set($id, $service, $scope = self::SCOPE_CONTAINER)   X-Ref
Sets a service.

Note: The $scope parameter is deprecated since version 2.8 and will be removed in 3.0.

param: string $id      The service identifier
param: object $service The service instance
param: string $scope   The scope

removeDefinition($id)   X-Ref
Removes a service definition.

param: string $id The service identifier

has($id)   X-Ref
Returns true if the given service is defined.

param: string $id The service identifier
return: bool true if the service is defined, false otherwise

get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)   X-Ref
Gets a service.

param: string $id              The service identifier
param: int    $invalidBehavior The behavior when the service does not exist
return: object The associated service

merge(ContainerBuilder $container)   X-Ref
Merges a ContainerBuilder with the current ContainerBuilder configuration.

Service definitions overrides the current defined ones.

But for parameters, they are overridden by the current ones. It allows
the parameters passed to the container constructor to have precedence
over the loaded ones.

$container = new ContainerBuilder(new ParameterBag(array('foo' => 'bar')));
$loader = new LoaderXXX($container);
$loader->load('resource_name');
$container->register('foo', 'stdClass');

In the above example, even if the loaded resource defines a foo
parameter, the value will still be 'bar' as defined in the ContainerBuilder
constructor.


getExtensionConfig($name)   X-Ref
Returns the configuration array for the given extension.

param: string $name The name of the extension
return: array An array of configuration

prependExtensionConfig($name, array $config)   X-Ref
Prepends a config array to the configs of the given extension.

param: string $name   The name of the extension
param: array  $config The config to set

compile()   X-Ref
Compiles the container.

This method passes the container to compiler
passes whose job is to manipulate and optimize
the container.

The main compiler passes roughly do four things:

* The extension configurations are merged;
* Parameter values are resolved;
* The parameter bag is frozen;
* Extension loading is disabled.

getServiceIds()   X-Ref
Gets all service ids.

return: array An array of all defined service ids

addAliases(array $aliases)   X-Ref
Adds the service aliases.


setAliases(array $aliases)   X-Ref
Sets the service aliases.


setAlias($alias, $id)   X-Ref
Sets an alias for an existing service.

param: string       $alias The alias to create
param: string|Alias $id    The service to alias

removeAlias($alias)   X-Ref
Removes an alias.

param: string $alias The alias to remove

hasAlias($id)   X-Ref
Returns true if an alias exists under the given identifier.

param: string $id The service identifier
return: bool true if the alias exists, false otherwise

getAliases()   X-Ref
Gets all defined aliases.

return: Alias[] An array of aliases

getAlias($id)   X-Ref
Gets an alias.

param: string $id The service identifier
return: Alias An Alias instance

register($id, $class = null)   X-Ref
Registers a service definition.

This methods allows for simple registration of service definition
with a fluid interface.

param: string $id         The service identifier
param: string $class|null The service class
return: Definition A Definition instance

addDefinitions(array $definitions)   X-Ref
Adds the service definitions.

param: Definition[] $definitions An array of service definitions

setDefinitions(array $definitions)   X-Ref
Sets the service definitions.

param: Definition[] $definitions An array of service definitions

getDefinitions()   X-Ref
Gets all service definitions.

return: Definition[] An array of Definition instances

setDefinition($id, Definition $definition)   X-Ref
Sets a service definition.

param: string     $id         The service identifier
param: Definition $definition A Definition instance
return: Definition the service definition

hasDefinition($id)   X-Ref
Returns true if a service definition exists under the given identifier.

param: string $id The service identifier
return: bool true if the service definition exists, false otherwise

getDefinition($id)   X-Ref
Gets a service definition.

param: string $id The service identifier
return: Definition A Definition instance

findDefinition($id)   X-Ref
Gets a service definition by id or alias.

The method "unaliases" recursively to return a Definition instance.

param: string $id The service identifier or alias
return: Definition A Definition instance

createService(Definition $definition, \SplObjectStorage $inlinedDefinitions, $id = null, $tryProxy = true)   X-Ref
Creates a service for a service definition.

param: Definition $definition A service definition instance
param: string     $id         The service identifier
param: bool       $tryProxy   Whether to try proxying the service with a lazy proxy
return: object The service described by the service definition

resolveServices($value)   X-Ref
Replaces service references by the real service instance and evaluates expressions.

param: mixed $value A value
return: mixed The same value with all service references replaced by

doResolveServices($value, \SplObjectStorage $inlinedDefinitions)   X-Ref
No description

findTaggedServiceIds($name)   X-Ref
Returns service ids for a given tag.

Example:

$container->register('foo')->addTag('my.tag', array('hello' => 'world'));

$serviceIds = $container->findTaggedServiceIds('my.tag');
foreach ($serviceIds as $serviceId => $tags) {
foreach ($tags as $tag) {
echo $tag['hello'];
}
}

param: string $name The tag name
return: array An array of tags with the tagged service as key, holding a list of attribute arrays

findTags()   X-Ref
Returns all tags the defined services use.

return: array An array of tags

findUnusedTags()   X-Ref
Returns all tags not queried by findTaggedServiceIds.

return: string[] An array of tags

addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider)   X-Ref
No description

getExpressionLanguageProviders()   X-Ref

return: ExpressionFunctionProviderInterface[]

getServiceConditionals($value)   X-Ref
Returns the Service Conditionals.

param: mixed $value An array of conditionals to return
return: array An array of Service conditionals

getProxyInstantiator()   X-Ref
Retrieves the currently set proxy instantiator or instantiates one.

return: InstantiatorInterface

synchronize($id)   X-Ref
Synchronizes a service change.

This method updates all services that depend on the given
service by calling all methods referencing it.

param: string $id A service id

callMethod($service, $call, \SplObjectStorage $inlinedDefinitions)   X-Ref
No description

shareService(Definition $definition, $service, $id, \SplObjectStorage $inlinedDefinitions)   X-Ref
Shares a given service in the container.

param: Definition  $definition
param: mixed       $service
param: string|null $id

getExpressionLanguage()   X-Ref
No description



Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1