Elgg  Version 1.10
Public Member Functions | Protected Attributes | List of all members
Elgg\Http\ParameterBag Class Reference
Inheritance diagram for Elgg\Http\ParameterBag:

Public Member Functions

 __construct (array $parameters=array())
 Constructor. More...
 
 all ()
 Returns the parameters. More...
 
 keys ()
 Returns the parameter keys. More...
 
 replace (array $parameters=array())
 Replaces the current parameters by a new set. More...
 
 add (array $parameters=array())
 Adds parameters. More...
 
 get ($path, $default=null, $deep=false)
 Returns a parameter by name. More...
 
 set ($key, $value)
 Sets a parameter by name. More...
 
 has ($key)
 Returns true if the parameter is defined. More...
 
 remove ($key)
 Removes a parameter. More...
 
 getAlpha ($key, $default= '', $deep=false)
 Returns the alphabetic characters of the parameter value. More...
 
 getAlnum ($key, $default= '', $deep=false)
 Returns the alphabetic characters and digits of the parameter value. More...
 
 getDigits ($key, $default= '', $deep=false)
 Returns the digits of the parameter value. More...
 
 getInt ($key, $default=0, $deep=false)
 Returns the parameter value converted to integer. More...
 
 filter ($key, $default=null, $deep=false, $filter=FILTER_DEFAULT, $options=array())
 Filter key. More...
 
 getIterator ()
 Returns an iterator for parameters. More...
 
 count ()
 Returns the number of parameters. More...
 

Protected Attributes

 $parameters
 

Detailed Description

Definition at line 36 of file ParameterBag.php.

Constructor & Destructor Documentation

Elgg\Http\ParameterBag::__construct ( array  $parameters = array())

Constructor.

Parameters
array$parametersAn array of parameters

Definition at line 50 of file ParameterBag.php.

Member Function Documentation

Elgg\Http\ParameterBag::add ( array  $parameters = array())

Adds parameters.

Parameters
array$parametersAn array of parameters
Returns
void

Definition at line 88 of file ParameterBag.php.

Elgg\Http\ParameterBag::all ( )

Returns the parameters.

Returns
array An array of parameters

Definition at line 59 of file ParameterBag.php.

Elgg\Http\ParameterBag::count ( )

Returns the number of parameters.

Returns
int The number of parameters

Definition at line 280 of file ParameterBag.php.

Elgg\Http\ParameterBag::filter (   $key,
  $default = null,
  $deep = false,
  $filter = FILTER_DEFAULT,
  $options = array() 
)

Filter key.

Parameters
string$keyKey.
mixed$defaultDefault = null.
boolean$deepDefault = false.
integer$filterFILTER_* constant.
mixed$optionsFilter options.
See also
http://php.net/manual/en/function.filter-var.php
Returns
mixed

Definition at line 250 of file ParameterBag.php.

Elgg\Http\ParameterBag::get (   $path,
  $default = null,
  $deep = false 
)

Returns a parameter by name.

Parameters
string$pathThe key
mixed$defaultThe default value if the parameter key does not exist
boolean$deepIf true, a path like foo[bar] will find deeper items
Returns
mixed
Exceptions

Definition at line 104 of file ParameterBag.php.

Elgg\Http\ParameterBag::getAlnum (   $key,
  $default = '',
  $deep = false 
)

Returns the alphabetic characters and digits of the parameter value.

Parameters
string$keyThe parameter key
mixed$defaultThe default value if the parameter key does not exist
boolean$deepIf true, a path like foo[bar] will find deeper items
Returns
string The filtered value

Definition at line 206 of file ParameterBag.php.

Elgg\Http\ParameterBag::getAlpha (   $key,
  $default = '',
  $deep = false 
)

Returns the alphabetic characters of the parameter value.

Parameters
string$keyThe parameter key
mixed$defaultThe default value if the parameter key does not exist
boolean$deepIf true, a path like foo[bar] will find deeper items
Returns
string The filtered value

Definition at line 193 of file ParameterBag.php.

Elgg\Http\ParameterBag::getDigits (   $key,
  $default = '',
  $deep = false 
)

Returns the digits of the parameter value.

Parameters
string$keyThe parameter key
mixed$defaultThe default value if the parameter key does not exist
boolean$deepIf true, a path like foo[bar] will find deeper items
Returns
string The filtered value

Definition at line 219 of file ParameterBag.php.

Elgg\Http\ParameterBag::getInt (   $key,
  $default = 0,
  $deep = false 
)

Returns the parameter value converted to integer.

Parameters
string$keyThe parameter key
mixed$defaultThe default value if the parameter key does not exist
boolean$deepIf true, a path like foo[bar] will find deeper items
Returns
integer The filtered value

Definition at line 233 of file ParameterBag.php.

Elgg\Http\ParameterBag::getIterator ( )

Returns an iterator for parameters.

Returns

Definition at line 271 of file ParameterBag.php.

Elgg\Http\ParameterBag::has (   $key)

Returns true if the parameter is defined.

Parameters
string$keyThe key
Returns
boolean true if the parameter exists, false otherwise

Definition at line 170 of file ParameterBag.php.

Elgg\Http\ParameterBag::keys ( )

Returns the parameter keys.

Returns
array An array of parameter keys

Definition at line 68 of file ParameterBag.php.

Elgg\Http\ParameterBag::remove (   $key)

Removes a parameter.

Parameters
string$keyThe key
Returns
void

Definition at line 180 of file ParameterBag.php.

Elgg\Http\ParameterBag::replace ( array  $parameters = array())

Replaces the current parameters by a new set.

Parameters
array$parametersAn array of parameters
Returns
void

Definition at line 78 of file ParameterBag.php.

Elgg\Http\ParameterBag::set (   $key,
  $value 
)

Sets a parameter by name.

Parameters
string$keyThe key
mixed$valueThe value
Returns
void

Definition at line 159 of file ParameterBag.php.

Member Data Documentation

Elgg\Http\ParameterBag::$parameters
protected

Definition at line 43 of file ParameterBag.php.


The documentation for this class was generated from the following file: