Class MOXMAN_Util_NameValueCollection

InheritanceMOXMAN_Util_NameValueCollection
ImplementsIteratorAggregate
SubclassesMOXMAN_Util_Config, MOXMAN_Vfs_FileMetaData

This class enables you to get/put values in based on keys.

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$items array MOXMAN_Util_NameValueCollection

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Constructs a new NameValueCollection with the specified array as it's internal items. MOXMAN_Util_NameValueCollection
extend() Extends the current collection with another collection or array. MOXMAN_Util_NameValueCollection
get() Returns the specified item by name or the default value if it shouldn't be defined in the internal name/value array. MOXMAN_Util_NameValueCollection
getAll() Returns the internal items array. MOXMAN_Util_NameValueCollection
getGroup() Returns the specified group as a new name/value array- MOXMAN_Util_NameValueCollection
getIterator() Returns an iterator intance for the internal array. MOXMAN_Util_NameValueCollection
put() Sets the value of a item by name. MOXMAN_Util_NameValueCollection
putAll() Sets the internal items array. MOXMAN_Util_NameValueCollection
remove() Removes a specific key by name. MOXMAN_Util_NameValueCollection

Property Details

$items protected property
protected array $items null

Method Details

__construct() public method

Constructs a new NameValueCollection with the specified array as it's internal items.

public void __construct ( array $items = [] )
$items array

Array with the internal items to set.

extend() public method

Extends the current collection with another collection or array.

public MOXMAN_Util_NameValueCollection extend ( $items )
$items Mixed

Name/Value array or other instance to extend with.

return MOXMAN_Util_NameValueCollection

Returns the current extended instance.

get() public method

Returns the specified item by name or the default value if it shouldn't be defined in the internal name/value array.

public Mixed get ( $name, $default false )
$name string

Name of the item to retrive.

$default Mixed

Default value to return if the item wasn't found.

return Mixed

Item value or default value if it wasn't found.

getAll() public method

Returns the internal items array.

public Array getAll ( )
return Array

Internal name/value array with items.

getGroup() public method

Returns the specified group as a new name/value array-

public Array getGroup ( $prefix )
$prefix string

Prefix/group to export for example "filesystem".

return Array

Name/value array with expored group.

getIterator() public method

Returns an iterator intance for the internal array.

public void getIterator ( )
put() public method

Sets the value of a item by name.

public \Current put ( $name, $value )
$name string

Name of item to set.

$value Mixed

Value to set for the item.

return \Current

Instance.

putAll() public method

Sets the internal items array.

public void putAll ( $items )
$items Array

Internal name/value array with items.

remove() public method

Removes a specific key by name.

public \Current remove ( $name )
$name mixed

Key to remove.

return \Current

Instance.