LdapTools\DomainConfiguration::load PHP Method

load() public method

Load a configuration from an array of values. The keys must be the same name as their YAML config names.
public load ( array $config )
$config array
    public function load(array $config)
    {
        $config = $this->getParsedConfig($config, $this->config, $this->yamlConfigMap, $this->required);
        $this->setParsedConfig($config);
        return $this;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Iterates through and loads the domain section of the configuration.
  *
  * @param $config
  * @throws ConfigurationException
  */
 protected function loadDomainConfiguration(array $config)
 {
     try {
         foreach ($config['domains'] as $domain => $options) {
             $domain = new DomainConfiguration();
             $domain->load($options);
             $this->addDomain($domain);
         }
     } catch (ConfigurationException $e) {
         throw new ConfigurationException(sprintf("Error in domain config section: %s", $e->getMessage()));
     }
 }