PHP Класс Pop\Config

Автор: Nick Sagona, III ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$allowChanges boolean Flag for whether or not changes are allowed after object instantiation
$array array Config values as an array
$config array Config values as config objects

Открытые методы

Метод Описание
__construct ( array $config = [], boolean $changes = false ) : Config Constructor
__get ( string $name ) : mixed Magic get method to return the value of config[$name].
__isset ( string $name ) : boolean Return the isset value of config[$name].
__set ( string $name, mixed $value ) : void Set method to set the property to the value of config[$name].
__unset ( string $name ) : void Unset config[$name].
asArray ( ) : array Method to get the config values as an array
asArrayObject ( ) : array Method to get the config values as an ArrayObject
changesAllowed ( ) : boolean Method to return if changes to the config are allowed.
factory ( array $config = [], boolean $changes = false ) : Config Static method to instantiate the config object and return itself to facilitate chaining methods together.
get ( string $name ) : mixed Get method to return the value of config[$name].
merge ( mixed $config ) : Config Method to merge the values of another config object into this one

Защищенные методы

Метод Описание
getConfig ( ) : void Method to get the config values as array
getConfigObject ( ) : void Method to get the config values as ArrayObject
setConfig ( array $config ) : void Method to set the config values

Описание методов

__construct() публичный Метод

Instantiate a config object
public __construct ( array $config = [], boolean $changes = false ) : Config
$config array
$changes boolean
Результат Config

__get() публичный Метод

Magic get method to return the value of config[$name].
public __get ( string $name ) : mixed
$name string
Результат mixed

__isset() публичный Метод

Return the isset value of config[$name].
public __isset ( string $name ) : boolean
$name string
Результат boolean

__set() публичный Метод

Set method to set the property to the value of config[$name].
public __set ( string $name, mixed $value ) : void
$name string
$value mixed
Результат void

__unset() публичный Метод

Unset config[$name].
public __unset ( string $name ) : void
$name string
Результат void

asArray() публичный Метод

Method to get the config values as an array
public asArray ( ) : array
Результат array

asArrayObject() публичный Метод

Method to get the config values as an ArrayObject
public asArrayObject ( ) : array
Результат array

changesAllowed() публичный Метод

Method to return if changes to the config are allowed.
public changesAllowed ( ) : boolean
Результат boolean

factory() публичный статический Метод

Static method to instantiate the config object and return itself to facilitate chaining methods together.
public static factory ( array $config = [], boolean $changes = false ) : Config
$config array
$changes boolean
Результат Config

get() публичный Метод

Get method to return the value of config[$name].
public get ( string $name ) : mixed
$name string
Результат mixed

getConfig() защищенный Метод

Method to get the config values as array
protected getConfig ( ) : void
Результат void

getConfigObject() защищенный Метод

Method to get the config values as ArrayObject
protected getConfigObject ( ) : void
Результат void

merge() публичный Метод

Method to merge the values of another config object into this one
public merge ( mixed $config ) : Config
$config mixed
Результат Config

setConfig() защищенный Метод

Method to set the config values
protected setConfig ( array $config ) : void
$config array
Результат void

Описание свойств

$allowChanges защищенное свойство

Flag for whether or not changes are allowed after object instantiation
protected bool $allowChanges
Результат boolean

$array защищенное свойство

Config values as an array
protected array $array
Результат array

$config защищенное свойство

Config values as config objects
protected array $config
Результат array