Craft\ImportService::getService PHP Method

getService() public method

Get service to use for importing.
public getService ( stirng $elementType ) : craft\IImportElementType | boolean
$elementType stirng
return craft\IImportElementType | boolean
    public function getService($elementType)
    {
        // Check if there's a service for this element type elsewhere
        $service = craft()->plugins->callFirst('registerImportService', array('elementType' => $elementType));
        // If not, do internal check
        if ($service == null) {
            // Get from right elementType
            $service = 'import_' . strtolower($elementType);
        }
        // Check if elementtype can be imported
        if (isset(craft()->{$service}) && craft()->{$service} instanceof IImportElementType) {
            // Return this service
            return craft()->{$service};
        }
        return false;
    }