Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
Config Class Reference

Provides a property based interface to an array. More...

Public Member Functions

 __construct (array $array, $allowModifications=false)
 Constructor.
 
 get ($name, $default=null)
 Retrieve a value and return $default if there is no element set.
 
 __get ($name)
 Magic function so that $obj->value will work.
 
 __set ($name, $value)
 Set a value in the config.
 
 __clone ()
 Deep clone of this instance to ensure that nested Zend are also cloned.
 
 __isset ($name)
 isset() overloading
 
 __unset ($name)
 unset() overloading
 
 count ()
 count(): defined by Countable interface.
 
 current ()
 current(): defined by Iterator interface.
 
 key ()
 key(): defined by Iterator interface.
 
 next ()
 next(): defined by Iterator interface.
 
 rewind ()
 rewind(): defined by Iterator interface.
 
 valid ()
 valid(): defined by Iterator interface.
 
 offsetExists ($offset)
 offsetExists(): defined by ArrayAccess interface.
 
 offsetGet ($offset)
 offsetGet(): defined by ArrayAccess interface.
 
 offsetSet ($offset, $value)
 offsetSet(): defined by ArrayAccess interface.
 
 offsetUnset ($offset)
 offsetUnset(): defined by ArrayAccess interface.
 
 isReadOnly ()
 Returns whether this Config object is read only or not.
 

Protected Attributes

 $allowModifications
 
 $data = []
 
 $skipNextIteration
 

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

Constructor & Destructor Documentation

__construct ( array  $array,
  $allowModifications = false 
)

Constructor.

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

Parameters
array$array
bool$allowModifications

Member Function Documentation

__clone ( )

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

Returns
void
__get (   $name)

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

Parameters
string$name
Returns
mixed
__isset (   $name)

isset() overloading

Parameters
string$name
Returns
bool
__set (   $name,
  $value 
)

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$name
mixed$value
Returns
void
Exceptions
Exception\RuntimeException
__unset (   $name)

unset() overloading

Parameters
string$name
Returns
void
Exceptions
Exception\InvalidArgumentException
count ( )

count(): defined by Countable interface.

See Also
Countable::count()
Returns
int
current ( )

current(): defined by Iterator interface.

See Also
Iterator::current()
Returns
mixed
get (   $name,
  $default = null 
)

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

Parameters
string$name
mixed$default
Returns
mixed
isReadOnly ( )

Returns whether this Config object is read only or not.

Returns
bool
key ( )

key(): defined by Iterator interface.

See Also
Iterator::key()
Returns
mixed
next ( )

next(): defined by Iterator interface.

See Also
Iterator::next()
Returns
void
offsetExists (   $offset)

offsetExists(): defined by ArrayAccess interface.

See Also
ArrayAccess::offsetExists()
Parameters
mixed$offset
Returns
bool
offsetGet (   $offset)

offsetGet(): defined by ArrayAccess interface.

See Also
ArrayAccess::offsetGet()
Parameters
mixed$offset
Returns
mixed
offsetSet (   $offset,
  $value 
)

offsetSet(): defined by ArrayAccess interface.

See Also
ArrayAccess::offsetSet()
Parameters
mixed$offset
mixed$value
Returns
void
offsetUnset (   $offset)

offsetUnset(): defined by ArrayAccess interface.

See Also
ArrayAccess::offsetUnset()
Parameters
mixed$offset
Returns
void
rewind ( )

rewind(): defined by Iterator interface.

See Also
Iterator::rewind()
Returns
void
valid ( )

valid(): defined by Iterator interface.

See Also
Iterator::valid()
Returns
bool

Member Data Documentation

$allowModifications
protected
$data = []
protected
$skipNextIteration
protected