Trait SeparatorAwareTrait
Methods summary
final public
Charcoal\Config\SeparatorAwareTrait
|
#
setSeparator( string $separator )
Sets the token for traversing a data-tree.
Sets the token for traversing a data-tree.
Parameters
- $separator
The single-character token to delimit nested data.
If the token is an empty string, data-tree traversal is disabled.
Returns
Throws
InvalidArgumentException If the $separator is invalid.
|
final public
string
|
#
separator( )
Gets the token for traversing a data-tree, if any.
Gets the token for traversing a data-tree, if any.
Returns
string
|
final protected
boolean
|
#
hasWithSeparator( string $key )
Determines if this store contains the key-path and if its value is not NULL.
Determines if this store contains the key-path and if its value is not NULL.
Traverses each node in the key-path until the endpoint is located.
Parameters
- $key
- The key-path to check.
Returns
boolean TRUE if $key exists and has a value other than NULL, FALSE otherwise.
Used by
|
final protected
mixed
|
#
getWithSeparator( string $key )
Returns the value from the key-path found on this object.
Returns the value from the key-path found on this object.
Traverses each node in the key-path until the endpoint is located.
Parameters
- $key
- The key-path to retrieve.
Returns
mixed Value of the requested $key on success, NULL if the $key is not set.
Used by
|
final protected
|
#
setWithSeparator( string $key, mixed $value )
Assign a value to the key-path, replacing / merging existing data with the same endpoint.
Assign a value to the key-path, replacing / merging existing data with the same endpoint.
Traverses, in reverse, each node in the key-path from the endpoint.
Parameters
- $key
- The key-path to assign $value to.
- $value
- The data value to assign to $key.
Used by
|
Properties summary
protected
string
|
$separator
Token for accessing nested data.
Token for accessing nested data.
Is empty by default (which disables the separator feature).
|
|