SymfonyComponentHttpFoundationParameterBag

ParameterBag is a container for key/value pairs.

Summary

No protected methods found
N/A
No private methods found
No private properties found
N/A
File
vendorSymfonyComponentHttpFoundationParameterBag.php
Package
Default
Class hierarchy
SymfonyComponentHttpFoundationParameterBag
Implements

Tags

author

Fabien Potencier fabien@symfony.com

api

Properties

$parameters

$parameters : array

Parameter storage.

Type

array

Tags

None found

Methods

__construct()

__construct(array  $parameters = array()) 

Constructor.

Parameters

array $parameters

An array of parameters

Tags

api

all()

all() : array

Returns the parameters.

Returns

array —

An array of parameters

Tags

api

keys()

keys() : array

Returns the parameter keys.

Returns

array —

An array of parameter keys

Tags

api

replace()

replace(array  $parameters = array()) 

Replaces the current parameters by a new set.

Parameters

array $parameters

An array of parameters

Tags

api

add()

add(array  $parameters = array()) 

Adds parameters.

Parameters

array $parameters

An array of parameters

Tags

api

get()

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

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

Throws

InvalidArgumentException

Returns

mixed

Tags

api

set()

set(string  $key, mixed  $value) 

Sets a parameter by name.

Parameters

string $key

The key

mixed $value

The value

Tags

api

has()

has(string  $key) : Boolean

Returns true if the parameter is defined.

Parameters

string $key

The key

Returns

Boolean —

true if the parameter exists, false otherwise

Tags

api

remove()

remove(string  $key) 

Removes a parameter.

Parameters

string $key

The key

Tags

api

getAlpha()

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

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

Returns

string —

The filtered value

Tags

api

getAlnum()

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

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

Returns

string —

The filtered value

Tags

api

getDigits()

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

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

Returns

string —

The filtered value

Tags

api

getInt()

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

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

Returns

integer —

The filtered value

Tags

api

filter()

filter(string  $key, mixed  $default = null, boolean  $deep = false, integer  $filter = FILTER_DEFAULT, mixed  $options = array()) : mixed

Filter key.

Parameters

string $key

Key.

mixed $default

Default = null.

boolean $deep

Default = false.

integer $filter

FILTER_* constant.

mixed $options

Filter options.

Returns

mixed

See also

Tags

None found

getIterator()

getIterator() : \ArrayIterator

Returns an iterator for parameters.

Returns

ArrayIterator —

An ArrayIterator instance

Tags

None found

count()

count() : integer

Returns the number of parameters.

Returns

integer —

The number of parameters

Tags

None found