PHP Класс DataSift\Storyplayer\ConfigLib\WrappedConfig

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

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

Метод Описание
__construct ( $isArray = false ) constructor
getArray ( string $path ) : array retrieve data from a dot.notation.path
getConfig ( ) : array | object get the config that we wrap
getData ( string $path ) : mixed retrieve data using a dot.notation.path
getExpandedConfig ( array | object | null $baseConfig = null ) : array | object expand any variables in $this
getFilename ( ) : string | null returns the filename we loaded this config from
getName ( ) : string | null returns the name assigned to this config
getObject ( string $path ) : object retrieve data from a dot.notation.path
hasData ( string $path ) : boolean check for existence of data using a dot.notation.path
loadConfigFromFile ( string $pathToFile ) : void load a config file from disk, and store the config in $this
mergeData ( string $path, mixed $dataToMerge ) : void merge data into this config
setConfig ( array | object $config ) store the config that we wrap
setData ( string $path, mixed $data ) : void assigns data to a specific path
setFilename ( string $filename ) sets the filename that we loaded this config from
setName ( string $name ) assigns a name to this config
unsetData ( string $path ) : void remove data using a dot.notation.path

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

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

constructor
public __construct ( $isArray = false )

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

throws an exception if the path does not point to an array
public getArray ( string $path ) : array
$path string the dot.notation.path to the data to return
Результат array

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

get the config that we wrap
public getConfig ( ) : array | object
Результат array | object

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

NOTE that you should treat any data returned from here as READ-ONLY
public getData ( string $path ) : mixed
$path string the dot.notation.path to use to navigate
Результат mixed

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

expand any variables in $this
public getExpandedConfig ( array | object | null $baseConfig = null ) : array | object
$baseConfig array | object | null the config to use for expanding variables (optional)
Результат array | object a copy of the config stored in $this, with any Twig variables expanded

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

returns the filename we loaded this config from
public getFilename ( ) : string | null
Результат string | null

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

returns the name assigned to this config
public getName ( ) : string | null
Результат string | null

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

throws an exception if the path does not point to an object
public getObject ( string $path ) : object
$path string the dot.notation.path to the data to return
Результат object

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

check for existence of data using a dot.notation.path
public hasData ( string $path ) : boolean
$path string the dot.notation.path to use to navigate
Результат boolean

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

load a config file from disk, and store the config in $this
public loadConfigFromFile ( string $pathToFile ) : void
$pathToFile string the filename to load from
Результат void

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

merge data into this config
public mergeData ( string $path, mixed $dataToMerge ) : void
$path string path.to.merge.to
$dataToMerge mixed the data to merge at $path
Результат void

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

store the config that we wrap
public setConfig ( array | object $config )
$config array | object the config to store

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

assigns data to a specific path
public setData ( string $path, mixed $data ) : void
$path string the path to assign to
$data mixed the data to assign
Результат void

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

sets the filename that we loaded this config from
public setFilename ( string $filename )
$filename string the filename to store

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

assigns a name to this config
public setName ( string $name )
$name string the name to assign

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

remove data using a dot.notation.path
public unsetData ( string $path ) : void
$path string the dot.notation.path to use to navigate
Результат void