Class MOXMAN_Util_NameValueCollection
Inheritance | MOXMAN_Util_NameValueCollection |
---|---|
Implements | IteratorAggregate |
Subclasses | MOXMAN_Util_Config, MOXMAN_Vfs_FileMetaData |
This class enables you to get/put values in based on keys.
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$items | array | MOXMAN_Util_NameValueCollection |
Public Methods
Method | Description | Defined 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
Method Details
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. |
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. |
---|
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. |
---|
Returns the internal items array.
public Array getAll ( ) | ||
return | Array | Internal name/value array with items. |
---|
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. |
---|
Returns an iterator intance for the internal array.
public void getIterator ( ) |
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. |
---|
Sets the internal items array.
public void putAll ( $items ) | ||
$items | Array | Internal name/value array with items. |
Removes a specific key by name.
public \Current remove ( $name ) | ||
$name | mixed | Key to remove. |
return | \Current | Instance. |
---|