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.
Synopsis
class Config
implements
Countable,Iterator,ArrayAccess
{
- // members
- protected bool $allowModifications;
- protected int $count;
- protected array $data;
- protected bool $skipNextIteration;
- // methods
- public void __construct()
- public mixed get()
- public mixed __get()
- public void __set()
- public void __clone()
- public array toArray()
- public bool __isset()
- public void __unset()
- public int count()
- public mixed current()
- public mixed key()
- public void next()
- public void rewind()
- public bool valid()
- public bool offsetExists()
- public mixed offsetGet()
- public void offsetSet()
- public void offsetUnset()
- public Config merge()
- public void setReadOnly()
- public bool isReadOnly()
Hierarchy
Implements
Members
protected
- $allowModifications
—
Zend\Config\bool
Whether modifications to configuration data are allowed. - $count
—
int
Number of elements in configuration data. - $data
—
array
Data within the configuration. - $skipNextIteration
—
Zend\Config\bool
Used when unsetting values during iteration to ensure we do not skip the next element.
Methods
public
- __construct() — Constructor.
- __clone() — Deep clone of this instance to ensure that nested Zend\Configs are also cloned.
- __get() — Magic function so that $obj->value will work.
- __isset() — isset() overloading
- __set() — Set a value in the config.
- __unset() — unset() overloading
- count() — count(): defined by Countable interface.
- current() — current(): defined by Iterator interface.
- get() — Retrieve a value and return $default if there is no element set.
- isReadOnly() — Returns whether this Config object is read only or not.
- key() — key(): defined by Iterator interface.
- merge() — Merge another Config with this one.
- next() — next(): defined by Iterator interface.
- offsetExists() — offsetExists(): defined by ArrayAccess interface.
- offsetGet() — offsetGet(): defined by ArrayAccess interface.
- offsetSet() — offsetSet(): defined by ArrayAccess interface.
- offsetUnset() — offsetUnset(): defined by ArrayAccess interface.
- rewind() — rewind(): defined by Iterator interface.
- setReadOnly() — Prevent any more modifications being made to this instance.
- toArray() — Return an associative array of the stored data.
- valid() — valid(): defined by Iterator interface.