Overview

Namespaces

  • Charcoal
    • Config

Classes

  • AbstractConfig
  • AbstractEntity
  • GenericConfig

Interfaces

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

Traits

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

Trait DelegatesAwareTrait

Provides an object with the ability to perform lookups in other objects.

A "delegate object" acts as a fallback when the current object does not have a requested value.

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

Direct Known Users

Charcoal\Config\AbstractConfig

Indirect Known Users

Charcoal\Config\GenericConfig
Namespace: Charcoal\Config
Located at Charcoal/Config/DelegatesAwareTrait.php
Methods summary
final public Charcoal\Config\DelegatesAwareTrait
# setDelegates( array $delegates )

Assigns a collection of delegare objects.

Assigns a collection of delegare objects.

Parameters

$delegates
One or more delegate objects to register.

Returns

Charcoal\Config\DelegatesAwareTrait
final public Charcoal\Config\DelegatesAwareTrait
# addDelegate( Charcoal\Config\EntityInterface $delegate )

Appends a delegare object onto the delegate stack.

Appends a delegare object onto the delegate stack.

Parameters

$delegate
A delegate object to register.

Returns

Charcoal\Config\DelegatesAwareTrait
final public Charcoal\Config\DelegatesAwareTrait
# prependDelegate( Charcoal\Config\EntityInterface $delegate )

Prepends a delegare object onto the delegate stack.

Prepends a delegare object onto the delegate stack.

Parameters

$delegate
A delegate object to register.

Returns

Charcoal\Config\DelegatesAwareTrait
final protected boolean
# hasInDelegates( string $key )

Determines if a delegate object contains the specified key and if its value is not NULL.

Determines if a delegate object contains the specified key and if its value is not NULL.

Iterates over each object in the delegate stack and stops on the first match containing the specified key.

Parameters

$key
The data key 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
# getInDelegates( string $key )

Returns the value from the specified key found on the first delegate object.

Returns the value from the specified key found on the first delegate object.

Iterates over each object in the delegate stack and stops on the first match containing a value that is not NULL.

Parameters

$key
The data key to retrieve.

Returns

mixed
Value of the requested $key on success, NULL if the $key is not set.

Used by

Charcoal\Config\AbstractConfig::offsetGet()
API documentation generated by ApiGen