Elgg  Version 1.9
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 35 of file ParameterBag.php.

Constructor & Destructor Documentation

Elgg_Http_ParameterBag::__construct ( array  $parameters = array())

Constructor.

Parameters
array$parametersAn array of parameters

Definition at line 49 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 87 of file ParameterBag.php.

Elgg_Http_ParameterBag::all ( )

Returns the parameters.

Returns
array An array of parameters

Definition at line 58 of file ParameterBag.php.

Elgg_Http_ParameterBag::count ( )

Returns the number of parameters.

Returns
int The number of parameters

Definition at line 279 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 249 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
InvalidArgumentException

Definition at line 103 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 205 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 192 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 218 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 232 of file ParameterBag.php.

Elgg_Http_ParameterBag::getIterator ( )

Returns an iterator for parameters.

Returns
ArrayIterator

Definition at line 270 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 169 of file ParameterBag.php.

Elgg_Http_ParameterBag::keys ( )

Returns the parameter keys.

Returns
array An array of parameter keys

Definition at line 67 of file ParameterBag.php.

Elgg_Http_ParameterBag::remove (   $key)

Removes a parameter.

Parameters
string$keyThe key
Returns
void

Definition at line 179 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 77 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 158 of file ParameterBag.php.

Member Data Documentation

Elgg_Http_ParameterBag::$parameters
protected

Definition at line 42 of file ParameterBag.php.


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