Overview

Namespaces

  • Charcoal
    • Config

Classes

  • AbstractConfig
  • AbstractEntity
  • GenericConfig

Interfaces

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

Traits

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

Trait ConfigurableTrait

Provides an object with a ConfigInterface configuration container.

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

Namespace: Charcoal\Config
Located at Charcoal/Config/ConfigurableTrait.php
Methods summary
public Charcoal\Config\ConfigurableTrait
# setConfig( mixed $config )

Sets the object's configuration container.

Sets the object's configuration container.

Parameters

$config
The Config object, datamap, or filepath.

Returns

Charcoal\Config\ConfigurableTrait
Chainable

Throws

InvalidArgumentException
If the parameter is invalid.
public mixed
# config( string|null $key = null, mixed $default = null )

Gets the object's configuration container or a specific key from the container.

Gets the object's configuration container or a specific key from the container.

Parameters

$key
If provided, the data key to retrieve.
$default
The fallback value to return if $key does not exist.

Returns

mixed

If $key is NULL, the Config object is returned. If $key is given, its value on the Config object is returned. If the value of $key is NULL, the value of $default is returned.

protected Charcoal\Config\ConfigInterface
# createConfig( mixed $data = null )

Create a new ConfigInterface instance for the object.

Create a new ConfigInterface instance for the object.

Parameters

$data
Initial data. Either a filepath, a datamap, or a Config object.

Returns

Charcoal\Config\ConfigInterface
A new Config object.

See

Charcoal\Config\AbstractConfig
API documentation generated by ApiGen