PHP Class DataSift\Storyplayer\ConfigLib\WrappedConfig

Afficher le fichier Open project: datasift/storyplayer Class Usage Examples

Méthodes publiques

Méthode Description
__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

Method Details

__construct() public méthode

constructor
public __construct ( $isArray = false )

getArray() public méthode

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
Résultat array

getConfig() public méthode

get the config that we wrap
public getConfig ( ) : array | object
Résultat array | object

getData() public méthode

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
Résultat mixed

getExpandedConfig() public méthode

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)
Résultat array | object a copy of the config stored in $this, with any Twig variables expanded

getFilename() public méthode

returns the filename we loaded this config from
public getFilename ( ) : string | null
Résultat string | null

getName() public méthode

returns the name assigned to this config
public getName ( ) : string | null
Résultat string | null

getObject() public méthode

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
Résultat object

hasData() public méthode

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
Résultat boolean

loadConfigFromFile() public méthode

load a config file from disk, and store the config in $this
public loadConfigFromFile ( string $pathToFile ) : void
$pathToFile string the filename to load from
Résultat void

mergeData() public méthode

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
Résultat void

setConfig() public méthode

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

setData() public méthode

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
Résultat void

setFilename() public méthode

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

setName() public méthode

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

unsetData() public méthode

remove data using a dot.notation.path
public unsetData ( string $path ) : void
$path string the dot.notation.path to use to navigate
Résultat void