Class

Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag

class FrozenParameterBag extends ParameterBag

Holds read-only parameters.

Methods

__construct(array $parameters = array())

Constructor.

clear()

Clears all parameters.

add(array $parameters)

Adds parameters to the service container parameters.

array all()

Gets the service container parameters.

from ParameterBag
mixed get(string $name)

Gets a service container parameter.

from ParameterBag
set(string $name, mixed $value)

Sets a service container parameter.

bool has(string $name)

Returns true if a parameter name is defined.

from ParameterBag
remove(string $name)

Removes a parameter.

from ParameterBag
resolve()

Replaces parameter placeholders (%name%) by their values for all parameters.

from ParameterBag
mixed resolveValue(mixed $value, array $resolving = array())

Replaces parameter placeholders (%name%) by their values.

from ParameterBag
string resolveString(string $value, array $resolving = array())

Resolves parameters inside a string

from ParameterBag
isResolved()

from ParameterBag
mixed escapeValue(mixed $value)

Escape parameter placeholders %

from ParameterBag
mixed unescapeValue(mixed $value)

Unescape parameter placeholders %

from ParameterBag

Details

at line 37
public __construct(array $parameters = array())

Constructor.

For performance reasons, the constructor assumes that all keys are already lowercased.

This is always the case when used internally.

Parameters

array $parameters An array of parameters

at line 48
public clear()

Clears all parameters.

at line 58
public add(array $parameters)

Adds parameters to the service container parameters.

Parameters

array $parameters An array of parameters

in ParameterBag at line 73
public array all()

Gets the service container parameters.

Return Value

array An array of parameters

in ParameterBag at line 89
public mixed get(string $name)

Gets a service container parameter.

Parameters

string $name The parameter name

Return Value

mixed The parameter value

Exceptions

ParameterNotFoundException if the parameter is not defined

at line 68
public set(string $name, mixed $value)

Sets a service container parameter.

Parameters

string $name The parameter name
mixed $value The parameter value

in ParameterBag at line 134
public bool has(string $name)

Returns true if a parameter name is defined.

Parameters

string $name The parameter name

Return Value

bool true if the parameter name is defined, false otherwise

in ParameterBag at line 146
public remove(string $name)

Removes a parameter.

Parameters

string $name The parameter name

in ParameterBag at line 154
public resolve()

Replaces parameter placeholders (%name%) by their values for all parameters.

in ParameterBag at line 188
public mixed resolveValue(mixed $value, array $resolving = array())

Replaces parameter placeholders (%name%) by their values.

Parameters

mixed $value A value
array $resolving An array of keys that are being resolved (used internally to detect circular references)

Return Value

mixed The resolved value

Exceptions

ParameterNotFoundException if a placeholder references a parameter that does not exist
ParameterCircularReferenceException if a circular reference if detected
RuntimeException when a given parameter has a type problem.

in ParameterBag at line 218
public string resolveString(string $value, array $resolving = array())

Resolves parameters inside a string

Parameters

string $value The string to resolve
array $resolving An array of keys that are being resolved (used internally to detect circular references)

Return Value

string The resolved string

Exceptions

ParameterNotFoundException if a placeholder references a parameter that does not exist
ParameterCircularReferenceException if a circular reference if detected
RuntimeException when a given parameter has a type problem.

in ParameterBag at line 261
public isResolved()

in ParameterBag at line 269
public mixed escapeValue(mixed $value)

Escape parameter placeholders %

Parameters

mixed $value

Return Value

mixed

in ParameterBag at line 287
public mixed unescapeValue(mixed $value)

Unescape parameter placeholders %

Parameters

mixed $value

Return Value

mixed