Class

Symfony\Component\HttpFoundation\ParameterBag

class ParameterBag

ParameterBag is a container for key/value pairs.

Methods

__construct(array $parameters = array())

Constructor.

array all()

Returns the parameters.

array keys()

Returns the parameter keys.

replace(array $parameters = array())

Replaces the current parameters by a new set.

add(array $parameters = array())

Adds parameters.

get(string $path, mixed $default = null, boolean $deep = false)

Returns a parameter by name.

set(string $key, mixed $value)

Sets a parameter by name.

Boolean has(string $key)

Returns true if the parameter is defined.

remove(string $key)

Removes a parameter.

string getAlpha(string $key, mixed $default = '', boolean $deep = false)

Returns the alphabetic characters of the parameter value.

string getAlnum(string $key, mixed $default = '', boolean $deep = false)

Returns the alphabetic characters and digits of the parameter value.

string getDigits(string $key, mixed $default = '', boolean $deep = false)

Returns the digits of the parameter value.

integer getInt(string $key, mixed $default, boolean $deep = false)

Returns the parameter value converted to integer.

Details

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

Constructor.

Parameters

array $parameters An array of parameters

at line 44
public array all()

Returns the parameters.

Return Value

array An array of parameters

at line 56
public array keys()

Returns the parameter keys.

Return Value

array An array of parameter keys

at line 68
public replace(array $parameters = array())

Replaces the current parameters by a new set.

Parameters

array $parameters An array of parameters

at line 80
public add(array $parameters = array())

Adds parameters.

Parameters

array $parameters An array of parameters

at line 94
public get(string $path, mixed $default = null, boolean $deep = false)

Returns a parameter by name.

Parameters

string $path The key
mixed $default The default value if the parameter key does not exist
boolean $deep If true, a path like foo[bar] will find deeper items

at line 151
public set(string $key, mixed $value)

Sets a parameter by name.

Parameters

string $key The key
mixed $value The value

at line 165
public Boolean has(string $key)

Returns true if the parameter is defined.

Parameters

string $key The key

Return Value

Boolean true if the parameter exists, false otherwise

at line 177
public remove(string $key)

Removes a parameter.

Parameters

string $key The key

at line 193
public string getAlpha(string $key, mixed $default = '', boolean $deep = false)

Returns the alphabetic characters of the parameter value.

Parameters

string $key The parameter key
mixed $default The default value if the parameter key does not exist
boolean $deep If true, a path like foo[bar] will find deeper items

Return Value

string The filtered value

at line 209
public string getAlnum(string $key, mixed $default = '', boolean $deep = false)

Returns the alphabetic characters and digits of the parameter value.

Parameters

string $key The parameter key
mixed $default The default value if the parameter key does not exist
boolean $deep If true, a path like foo[bar] will find deeper items

Return Value

string The filtered value

at line 225
public string getDigits(string $key, mixed $default = '', boolean $deep = false)

Returns the digits of the parameter value.

Parameters

string $key The parameter key
mixed $default The default value if the parameter key does not exist
boolean $deep If true, a path like foo[bar] will find deeper items

Return Value

string The filtered value

at line 241
public integer getInt(string $key, mixed $default, boolean $deep = false)

Returns the parameter value converted to integer.

Parameters

string $key The parameter key
mixed $default The default value if the parameter key does not exist
boolean $deep If true, a path like foo[bar] will find deeper items

Return Value

integer The filtered value