233. Class

233.1. Zend\Config\Config

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.

233.1.1. Methods

233.1.1.1. __construct

__construct()

Constructor.

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

Parameters:
  • array
  • bool

233.1.1.2. get

get()

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

Parameters:
  • string
  • mixed
Return type:

mixed

233.1.1.3. __get

__get()

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

Parameters:string
Return type:mixed

233.1.1.4. __set

__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.

Parameters:
  • string
  • mixed
Return type:

void

Throws :

ExceptionRuntimeException

233.1.1.5. __clone

__clone()

Deep clone of this instance to ensure that nested ZendConfigs are also cloned.

Return type:void

233.1.1.6. toArray

toArray()

Return an associative array of the stored data.

Return type:array

233.1.1.7. __isset

__isset()

isset() overloading

Parameters:string
Return type:bool

233.1.1.8. __unset

__unset()

unset() overloading

Parameters:string
Return type:void
Throws :ExceptionInvalidArgumentException

233.1.1.9. count

count()

count(): defined by Countable interface.

Return type:integer

233.1.1.10. current

current()

current(): defined by Iterator interface.

Return type:mixed

233.1.1.11. key

key()

key(): defined by Iterator interface.

Return type:mixed

233.1.1.13. rewind

rewind()

rewind(): defined by Iterator interface.

Return type:void

233.1.1.14. valid

valid()

valid(): defined by Iterator interface.

Return type:bool

233.1.1.15. offsetExists

offsetExists()

offsetExists(): defined by ArrayAccess interface.

Parameters:mixed
Return type:bool

233.1.1.16. offsetGet

offsetGet()

offsetGet(): defined by ArrayAccess interface.

Parameters:mixed
Return type:mixed

233.1.1.17. offsetSet

offsetSet()

offsetSet(): defined by ArrayAccess interface.

Parameters:
  • mixed
  • mixed
Return type:

void

233.1.1.18. offsetUnset

offsetUnset()

offsetUnset(): defined by ArrayAccess interface.

Parameters:mixed
Return type:void

233.1.1.19. merge

merge()

Merge another Config with this one.

For duplicate keys, the following will be performed: - Nested Configs will be recursively merged. - Items in $merge with INTEGER keys will be appended. - Items in $merge with STRING keys will overwrite current values.

Parameters:Config
Return type:Config

233.1.1.20. setReadOnly

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.

Return type:void

233.1.1.21. isReadOnly

isReadOnly()

Returns whether this Config object is read only or not.

Return type:bool