*/ class ImportersService extends ConfigurableService { const SERVICE_ID = 'tao/Importers'; const OPTION_IMPORTERS = 'importers'; /** * @param $id * @return Importer * @throws ImporterNotFound */ public function getImporter($id) { $result = null; if ($this->hasOption(self::OPTION_IMPORTERS)) { $importers = $this->getOption(self::OPTION_IMPORTERS); if (isset($importers[$id])) { /** @var Importer $result */ $result = new $importers[$id](); $result->setServiceLocator($this->getServiceManager()); } } if ($result === null) { throw new ImporterNotFound('Importer `' . $id . '` not found.'); } return $result; } }