*/ class ImportByHandler extends AbstractAction { use OntologyAwareTrait; const PARAM_IMPORT_HANDLER = 'import_handler'; const PARAM_FORM_VALUES = 'form_values'; const PARAM_PARENT_CLASS = 'parent_class_uri'; const PARAM_OWNER = 'owner'; /** * @param array $params * @return Report */ public function __invoke($params) { if (!isset($params[self::PARAM_IMPORT_HANDLER]) || !class_exists($params[self::PARAM_IMPORT_HANDLER])) { throw new \InvalidArgumentException('Please provide a valid import handler'); } /** @var \tao_models_classes_import_ImportHandler $importer */ $importer = new $params[self::PARAM_IMPORT_HANDLER](); $this->propagate($importer); return $importer->import($this->getClass($params[self::PARAM_PARENT_CLASS]), $params[self::PARAM_FORM_VALUES], $params[self::PARAM_OWNER]); } }