Cascade\Config\Loader\ClassLoader::loadExtraOptions PHP Метод

loadExtraOptions() публичный Метод

Set extra options if any were requested
public loadExtraOptions ( array $extraOptions, mixed $instance )
$extraOptions array Array of extra options (key => value)
$instance mixed Instance you want to set options for
    public function loadExtraOptions($extraOptions, $instance)
    {
        foreach ($extraOptions as $name => $value) {
            if ($this->reflected->hasMethod($name)) {
                // There is a method to handle this option
                call_user_func_array(array($instance, $name), is_array($value) ? $value : array($value));
                continue;
            }
            if ($this->reflected->hasProperty($name) && $this->reflected->getProperty($name)->isPublic()) {
                // There is a public member we can set for this option
                $instance->{$name} = $value;
                continue;
            }
            if ($this->canHandle($name)) {
                // There is a custom handler for that option
                $closure = $this->getExtraOptionsHandler($name);
                $closure($instance, $value);
            }
        }
    }