Properties

$data

$data : array

Array data

Type

array

$allowChanges

$allowChanges : boolean

Flag for whether or not changes are allowed after object instantiation

Type

boolean

Methods

__construct()

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

Constructor

Instantiate a config object

Parameters

mixed $data
boolean $changes

createFromJson()

createFromJson(string  $jsonString, integer  $depth = 512, integer  $options) : \Pop\Utils\ArrayObject

Create array object from JSON string

Parameters

string $jsonString
integer $depth
integer $options

Returns

\Pop\Utils\ArrayObject

createFromSerialized()

createFromSerialized(string  $string) : \Pop\Utils\ArrayObject

Create array object from serialized string

Parameters

string $string

Returns

\Pop\Utils\ArrayObject

count()

count() : integer

Method to get the count of the array object

Returns

integer

getIterator()

getIterator() : \ArrayIterator

Method to iterate over the array object

Returns

\ArrayIterator

jsonSerialize()

jsonSerialize(integer  $options, integer  $depth = 512) : string

JSON serialize the array object

Parameters

integer $options
integer $depth

Returns

string

jsonUnserialize()

jsonUnserialize(string  $jsonString, integer  $depth = 512, integer  $options) : \Pop\Utils\ArrayObject

Unserialize a JSON string

Parameters

string $jsonString
integer $depth
integer $options

Returns

\Pop\Utils\ArrayObject

serialize()

serialize(boolean  $self = false) : string

Serialize the array object

Parameters

boolean $self

Returns

string

unserialize()

unserialize(string  $string) : \Pop\Utils\ArrayObject

Unserialize a string

Parameters

string $string

Throws

\Pop\Utils\Exception

Returns

\Pop\Utils\ArrayObject

__set()

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

Set a value

Parameters

string $name
mixed $value

Throws

\Pop\Config\Exception

__get()

__get(string  $name) : mixed

Get a value

Parameters

string $name

Returns

mixed

__isset()

__isset(string  $name) : boolean

Is value set

Parameters

string $name

Returns

boolean

__unset()

__unset(string  $name) : void

Unset a value

Parameters

string $name

Throws

\Pop\Config\Exception

offsetSet()

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

ArrayAccess offsetSet

Parameters

mixed $offset
mixed $value

offsetGet()

offsetGet(mixed  $offset) : mixed

ArrayAccess offsetGet

Parameters

mixed $offset

Returns

mixed

offsetExists()

offsetExists(mixed  $offset) : boolean

ArrayAccess offsetExists

Parameters

mixed $offset

Returns

boolean

offsetUnset()

offsetUnset(mixed  $offset) : void

ArrayAccess offsetUnset

Parameters

mixed $offset

toArray()

toArray() : array

Get the values as an array

Returns

array

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

merge()

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

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

toArrayObject()

toArrayObject() : \ArrayObject

Get the config values as an array

Returns

\ArrayObject

toJson()

toJson() : string

Get the config values as a JSON string

Returns

string

toIni()

toIni() : string

Get the config values as an INI string

Returns

string

toXml()

toXml() : string

Get the config values as an XML string

Returns

string

changesAllowed()

changesAllowed() : boolean

Return if changes to the config are allowed.

Returns

boolean

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