Properties

$allowChanges

$allowChanges : boolean

Flag for whether or not changes are allowed after object instantiation

Type

boolean

$values

$values : array

Config values

Type

array

Methods

__construct()

__construct(mixed  $values = array(), boolean  $changes = false) 

Constructor

Instantiate a config object

Parameters

mixed $values
boolean $changes

createFromData()

createFromData(mixed  $data, boolean  $changes = false) : self

Method to create a config object from parsed data

Parameters

mixed $data
boolean $changes

Returns

self

parseData()

parseData(mixed  $data) : array

Method to parse data and return config values

Parameters

mixed $data

Returns

array

count()

count() : integer

Method to get the count of data in the config

Returns

integer

getIterator()

getIterator() : \ArrayIterator

Method to iterate over the config

Returns

\ArrayIterator

merge()

merge(mixed  $values, boolean  $preserve = false) : \Pop\Config\Config

Merge the values of another config object into this one.

By default, existing values are overwritten, unless the $preserve flag is set to true.

Parameters

mixed $values
boolean $preserve

Throws

\Pop\Config\Exception

Returns

\Pop\Config\Config

mergeFromData()

mergeFromData(mixed  $data, boolean  $preserve = false) : \Pop\Config\Config

Merge the values of another config object into this one.

By default, existing values are overwritten, unless the $preserve flag is set to true.

Parameters

mixed $data
boolean $preserve

Throws

\Pop\Config\Exception

Returns

\Pop\Config\Config

writeToFile()

writeToFile(string  $filename) : void

Write the config data to file

Parameters

string $filename

Throws

\Pop\Config\Exception

toArray()

toArray() : array

Get the config value()s as an array

Returns

array

toArrayObject()

toArrayObject() : \ArrayObject

Get the config value()s as an array

Returns

\ArrayObject

toJson()

toJson() : string

Get the config value()s as a JSON string

Returns

string

toIni()

toIni() : string

Get the config value()s as an INI string

Returns

string

toXml()

toXml() : string

Get the config value()s as an XML string

Returns

string

changesAllowed()

changesAllowed() : boolean

Return if changes to the config are allowed.

Returns

boolean

__get()

__get(string  $name) : mixed

Magic get method to return the value of values[$name].

Parameters

string $name

Returns

mixed

__set()

__set(string  $name, mixed  $value) : void

Magic set method to set the property to the value of values[$name].

Parameters

string $name
mixed $value

Throws

\Pop\Config\Exception

__isset()

__isset(string  $name) : boolean

Return the isset value of values[$name].

Parameters

string $name

Returns

boolean

__unset()

__unset(string  $name) : void

Unset values[$name].

Parameters

string $name

Throws

\Pop\Config\Exception

offsetExists()

offsetExists(mixed  $offset) : boolean

ArrayAccess offsetExists

Parameters

mixed $offset

Returns

boolean

offsetGet()

offsetGet(mixed  $offset) : mixed

ArrayAccess offsetGet

Parameters

mixed $offset

Returns

mixed

offsetSet()

offsetSet(mixed  $offset, mixed  $value) : void

ArrayAccess offsetSet

Parameters

mixed $offset
mixed $value

offsetUnset()

offsetUnset(mixed  $offset) : void

ArrayAccess offsetUnset

Parameters

mixed $offset

setValues()

setValues(mixed  $values) : void

Method to set values of the config object

Parameters

mixed $values

arrayToXml()

arrayToXml(array  $array, \SimpleXMLElement  $config) : void

Method to convert array to XML

Parameters

array $array
\SimpleXMLElement $config

arrayToIni()

arrayToIni(array  $array) : string

Method to convert array to INI

Parameters

array $array

Returns

string