Fully Qualified Name: | Zend\Config\Config |
Implements: | Countable, Iterator, ArrayAccess |
Provides a property based interface to an array.
The data are read-only unless $allowModifications is set to true on construction.
Implements Countable, Iterator and ArrayAccess to facilitate easy access to the data.
Name | Description | Defined By |
---|---|---|
__clone() | Deep clone of this instance to ensure that nested Zend\Configs are also cloned. | Config |
__construct() | Constructor. | Config |
__get() | Magic function so that $obj->value will work. | Config |
__isset() | isset() overloading | Config |
__set() | Set a value in the config. | Config |
__unset() | unset() overloading | Config |
count() | count(): defined by Countable interface. | Config |
current() | current(): defined by Iterator interface. | Config |
get() | Retrieve a value and return $default if there is no element set. | Config |
isReadOnly() | Returns whether this Config object is read only or not. | Config |
key() | key(): defined by Iterator interface. | Config |
merge() | Merge another Config with this one. | Config |
next() | next(): defined by Iterator interface. | Config |
offsetExists() | offsetExists(): defined by ArrayAccess interface. | Config |
offsetGet() | offsetGet(): defined by ArrayAccess interface. | Config |
offsetSet() | offsetSet(): defined by ArrayAccess interface. | Config |
offsetUnset() | offsetUnset(): defined by ArrayAccess interface. | Config |
rewind() | rewind(): defined by Iterator interface. | Config |
setReadOnly() | Prevent any more modifications being made to this instance. | Config |
toArray() | Return an associative array of the stored data. | Config |
valid() | valid(): defined by Iterator interface. | Config |
Deep clone of this instance to ensure that nested Zend\Configs are also cloned.
Returns: void
Constructor.
Data is read-only unless $allowModifications is set to true on construction.
Parameter Name | Type | Description |
---|---|---|
$array | array | |
$allowModifications | bool |
Returns:
Magic function so that $obj->value will work.
Parameter Name | Type | Description |
---|---|---|
$name | string |
Returns: mixed
isset() overloading
Parameter Name | Type | Description |
---|---|---|
$name | string |
Returns: bool
Set a value in the config.
Only allow setting of a property if $allowModifications was set to true on construction. Otherwise, throw an exception.
Parameter Name | Type | Description |
---|---|---|
$name | string | |
$value | mixed |
Returns: void
unset() overloading
Parameter Name | Type | Description |
---|---|---|
$name | string |
Returns: void
count(): defined by Countable interface.
Returns: int
current(): defined by Iterator interface.
Returns: mixed
Retrieve a value and return $default if there is no element set.
Parameter Name | Type | Description |
---|---|---|
$name | string | |
$default | mixed |
Returns: mixed
Returns whether this Config object is read only or not.
Returns: bool
key(): defined by Iterator interface.
Returns: mixed
Merge another Config with this one.
For duplicate keys, the following will be performed:
Parameter Name | Type | Description |
---|---|---|
$merge | \Config |
Returns: self
next(): defined by Iterator interface.
Returns: void
offsetExists(): defined by ArrayAccess interface.
Parameter Name | Type | Description |
---|---|---|
$offset | mixed |
Returns: bool
offsetGet(): defined by ArrayAccess interface.
Parameter Name | Type | Description |
---|---|---|
$offset | mixed |
Returns: mixed
offsetSet(): defined by ArrayAccess interface.
Parameter Name | Type | Description |
---|---|---|
$offset | mixed | |
$value | mixed |
Returns: void
offsetUnset(): defined by ArrayAccess interface.
Parameter Name | Type | Description |
---|---|---|
$offset | mixed |
Returns: void
rewind(): defined by Iterator interface.
Returns: void
Prevent any more modifications being made to this instance.
Useful after merge() has been used to merge multiple Config objects into one object which should then not be modified again.
Returns: void
Return an associative array of the stored data.
Returns: array
valid(): defined by Iterator interface.
Returns: bool