public function create($type)
    {
        $typeOptions    = $this->getOption(self::OPTION_MAPPERS);
        $typeOption     = isset($typeOptions[$type]) ? $typeOptions[$type] : $this->throwException();
        $importerString = isset($typeOption[self::OPTION_MAPPERS_IMPORTER]) ? $typeOption[self::OPTION_MAPPERS_IMPORTER] : $this->throwException();
        $importer       = $this->buildService($importerString, ImportServiceInterface::class);

        if (isset($typeOption[self::OPTION_MAPPERS_MAPPER])) {
            $mapperString = $typeOption[self::OPTION_MAPPERS_MAPPER];
            $mapper       = $this->buildService($mapperString);
        } else {
            $mapper = $this->getDefaultMapper();
        }

        $this->propagate($mapper);
        $importer->setMapper($mapper);

        return $importer;
    }
public function create($type)
    {
        $typeOptions    = $this->getOption(self::OPTION_MAPPERS);
        $typeOption     = isset($typeOptions[$type]) ? $typeOptions[$type] : $this->throwException();
        $importerString = isset($typeOption[self::OPTION_MAPPERS_IMPORTER]) ? $typeOption[self::OPTION_MAPPERS_IMPORTER] : $this->throwException();
        $importer       = $this->buildService($importerString, ImportServiceInterface::class);

        if (isset($typeOption[self::OPTION_MAPPERS_MAPPER])) {
            $mapperString = $typeOption[self::OPTION_MAPPERS_MAPPER];
            $mapper       = $this->buildService($mapperString);
        } else {
            $mapper = $this->getDefaultMapper();
        }

        $this->propagate($mapper);
        $importer->setMapper($mapper);

        return $importer;
    }
public function create ( $ type ) { $ typeOptions = $ this -> getOption ( self :: OPTION_MAPPERS ) ; $ typeOption = isset ( $ typeOptions [ $ type ] ) ? $ typeOptions [ $ type ] : $ this -> throwException ( ) ; $ importerString = isset ( $ typeOption [ self :: OPTION_MAPPERS_IMPORTER ] ) ? $ typeOption [ self :: OPTION_MAPPERS_IMPORTER ] : $ this -> throwException ( ) ; $ importer = $ this -> buildService ( $ importerString , ImportServiceInterface :: class ) ; if ( isset ( $ typeOption [ self :: OPTION_MAPPERS_MAPPER ] ) ) { $ mapperString = $ typeOption [ self :: OPTION_MAPPERS_MAPPER ] ; $ mapper = $ this -> buildService ( $ mapperString ) ; } else { $ mapper = $ this -> getDefaultMapper ( ) ; } $ this -> propagate ( $ mapper ) ; $ importer -> setMapper ( $ mapper ) ; return $ importer ; }
Create an importer

User type is defined in a config mapper and is associated to a role

@param $type
@return ImportServiceInterface
@throws \common_exception_NotFound
@throws InvalidService
@throws InvalidServiceManagerException
Create an importer