Symfony API
Interface

Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface

interface ParameterBagInterface

ParameterBagInterface.

Methods

clear()

Clears all parameters.

add(array $parameters)

Adds parameters to the service container parameters.

array all()

Gets the service container parameters.

mixed get(string $name)

Gets a service container parameter.

remove(string $name)

Removes a parameter.

set(string $name, mixed $value)

Sets a service container parameter.

bool has(string $name)

Returns true if a parameter name is defined.

resolve()

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

resolveValue(mixed $value)

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

mixed escapeValue(mixed $value)

Escape parameter placeholders %.

mixed unescapeValue(mixed $value)

Unescape parameter placeholders %.

Details

at line 29
public clear()

Clears all parameters.

Exceptions

LogicException if the ParameterBagInterface can not be cleared

at line 38
public add(array $parameters)

Adds parameters to the service container parameters.

Parameters

array $parameters An array of parameters

Exceptions

LogicException if the parameter can not be added

at line 45
public array all()

Gets the service container parameters.

Return Value

array An array of parameters

at line 56
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 63
public remove(string $name)

Removes a parameter.

Parameters

string $name The parameter name

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

Sets a service container parameter.

Parameters

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

Exceptions

LogicException if the parameter can not be set

at line 82
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

at line 87
public resolve()

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

at line 96
public resolveValue(mixed $value)

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

Parameters

mixed $value A value

Exceptions

ParameterNotFoundException if a placeholder references a parameter that does not exist

at line 105
public mixed escapeValue(mixed $value)

Escape parameter placeholders %.

Parameters

mixed $value

Return Value

mixed

at line 114
public mixed unescapeValue(mixed $value)

Unescape parameter placeholders %.

Parameters

mixed $value

Return Value

mixed