You are here

public function AbstractOptions::__get in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-stdlib/src/AbstractOptions.php \Zend\Stdlib\AbstractOptions::__get()

Get a configuration property

Parameters

string $key:

Return value

mixed

Throws

Exception\BadMethodCallException

Overrides ParameterObjectInterface::__get

See also

ParameterObject::__get()

1 call to AbstractOptions::__get()
AbstractOptions::__isset in vendor/zendframework/zend-stdlib/src/AbstractOptions.php
Test if a configuration property is null

File

vendor/zendframework/zend-stdlib/src/AbstractOptions.php, line 127

Class

AbstractOptions

Namespace

Zend\Stdlib

Code

public function __get($key) {
  $getter = 'get' . str_replace('_', '', $key);
  if (is_callable([
    $this,
    $getter,
  ])) {
    return $this
      ->{$getter}();
  }
  throw new Exception\BadMethodCallException(sprintf('The option "%s" does not have a callable "%s" getter method which must be defined', $key, 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)))));
}