Class Config

Summary

Fully Qualified Name: Zend\Config\Config
Implements: Countable, Iterator, ArrayAccess

Description

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.

Methods

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

Method Details

__clone()

Deep clone of this instance to ensure that nested Zend\Configs are also cloned.

Returns: void

__construct()

Constructor.

Data is read-only unless $allowModifications is set to true on construction.

Parameter Name Type Description
$array array
$allowModifications bool

Returns:

__get()

Magic function so that $obj->value will work.

Parameter Name Type Description
$name string

Returns: mixed

__isset()

isset() overloading

Parameter Name Type Description
$name string

Returns: bool

__set()

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()

unset() overloading

Parameter Name Type Description
$name string

Returns: void

count()

count(): defined by Countable interface.

Returns: int

current()

current(): defined by Iterator interface.

Returns: mixed

get()

Retrieve a value and return $default if there is no element set.

Parameter Name Type Description
$name string
$default mixed

Returns: mixed

isReadOnly()

Returns whether this Config object is read only or not.

Returns: bool

key()

key(): defined by Iterator interface.

Returns: mixed

merge()

Merge another Config with this one.

For duplicate keys, the following will be performed:

Parameter Name Type Description
$merge \Config

Returns: self

next()

next(): defined by Iterator interface.

Returns: void

offsetExists()

offsetExists(): defined by ArrayAccess interface.

Parameter Name Type Description
$offset mixed

Returns: bool

offsetGet()

offsetGet(): defined by ArrayAccess interface.

Parameter Name Type Description
$offset mixed

Returns: mixed

offsetSet()

offsetSet(): defined by ArrayAccess interface.

Parameter Name Type Description
$offset mixed
$value mixed

Returns: void

offsetUnset()

offsetUnset(): defined by ArrayAccess interface.

Parameter Name Type Description
$offset mixed

Returns: void

rewind()

rewind(): defined by Iterator interface.

Returns: void

setReadOnly()

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

toArray()

Return an associative array of the stored data.

Returns: array

valid()

valid(): defined by Iterator interface.

Returns: bool

Top