getGeneratorConfig() public method

public getGeneratorConfig ( )
Beispiel #1
0
 public function getInstanceFor(EnrichConfig $enrichCfg)
 {
     $name = $enrichCfg->getType();
     if (!isset($this->enrichers[$name])) {
         throw new FactoryException("Enricher '{$name}' is not registered.", FactoryException::UnknownEnricher);
     }
     if (isset($this->configs[$name])) {
         $cfg = new $this->configs[$name]($enrichCfg->getGeneratorConfig(), $enrichCfg->getEnrichNode());
     } else {
         $cfg = $enrichCfg;
     }
     if ($this->enrichers[$name] instanceof FactoryInterface) {
         return $this->enrichers[$name]->getInstanceFor($name, $cfg);
     }
     return new $this->enrichers[$name]($cfg);
 }
Beispiel #2
0
 public function __construct(EnrichConfig $config)
 {
     $this->enrichers = array_keys($config->getGeneratorConfig()->getActiveEnrichSources());
     $this->version = $config->getVersion();
 }