Overview

Namespaces

  • Charcoal
    • Config

Classes

  • AbstractConfig
  • AbstractEntity
  • GenericConfig

Interfaces

  • ConfigInterface
  • ConfigurableInterface
  • DelegatesAwareInterface
  • EntityInterface
  • FileAwareInterface
  • SeparatorAwareInterface

Traits

  • ConfigurableTrait
  • DelegatesAwareTrait
  • FileAwareTrait
  • SeparatorAwareTrait
  • Overview
  • Namespace
  • Class

Trait SeparatorAwareTrait

Provides an object with the ability to perform lookups into multi-dimensional arrays.

This is a full implementation of Charcoal\Config\SeparatorAwareInterface.

Direct Known Users

Charcoal\Config\AbstractConfig

Indirect Known Users

Charcoal\Config\GenericConfig
Namespace: Charcoal\Config
Located at Charcoal/Config/SeparatorAwareTrait.php
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

Charcoal\Config\SeparatorAwareTrait

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

Charcoal\Config\AbstractConfig::offsetExists()
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

Charcoal\Config\AbstractConfig::offsetGet()
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

Charcoal\Config\AbstractConfig::offsetSet()
Properties summary
protected string $separator

Token for accessing nested data.

Token for accessing nested data.

Is empty by default (which disables the separator feature).

# ''
API documentation generated by ApiGen