protected function _createWebservice($className, array $options = [])
    {
        $webservice = App::className($className, 'Webservice', 'Webservice');
        if ($webservice) {
            return new $webservice($options);
        }

        $namespaceParts = explode('\\', get_class($this));
        $fallbackWebserviceClass = end($namespaceParts);

        list($pluginName) = pluginSplit($className);
        if ($pluginName) {
            $fallbackWebserviceClass = $pluginName . '.' . $fallbackWebserviceClass;
        }

        $fallbackWebservice = App::className($fallbackWebserviceClass, 'Webservice', 'Webservice');
        if ($fallbackWebservice) {
            return new $fallbackWebservice($options);
        }

        throw new MissingWebserviceClassException([
            'class' => $className,
            'fallbackClass' => $fallbackWebserviceClass
        ]);
    }
protected function _createWebservice($className, array $options = [])
    {
        $webservice = App::className($className, 'Webservice', 'Webservice');
        if ($webservice) {
            return new $webservice($options);
        }

        $namespaceParts = explode('\\', get_class($this));
        $fallbackWebserviceClass = end($namespaceParts);

        list($pluginName) = pluginSplit($className);
        if ($pluginName) {
            $fallbackWebserviceClass = $pluginName . '.' . $fallbackWebserviceClass;
        }

        $fallbackWebservice = App::className($fallbackWebserviceClass, 'Webservice', 'Webservice');
        if ($fallbackWebservice) {
            return new $fallbackWebservice($options);
        }

        throw new MissingWebserviceClassException([
            'class' => $className,
            'fallbackClass' => $fallbackWebserviceClass
        ]);
    }
protected function _createWebservice ( $ className , array $ options = [ ] ) { $ webservice = App :: className ( $ className , 'Webservice' , 'Webservice' ) ; if ( $ webservice ) { return new $ webservice ( $ options ) ; } $ namespaceParts = explode ( '\\' , get_class ( $ this ) ) ; $ fallbackWebserviceClass = end ( $ namespaceParts ) ; list ( $ pluginName ) = pluginSplit ( $ className ) ; if ( $ pluginName ) { $ fallbackWebserviceClass = $ pluginName . '.' . $ fallbackWebserviceClass ; } $ fallbackWebservice = App :: className ( $ fallbackWebserviceClass , 'Webservice' , 'Webservice' ) ; if ( $ fallbackWebservice ) { return new $ fallbackWebservice ( $ options ) ; } throw new MissingWebserviceClassException ( [ 'class' => $ className , 'fallbackClass' => $ fallbackWebserviceClass ] ) ; }
Creates a Webservice instance.

It provides a fallback to PluginNameWebservice.

@param string $className Class name of the webservice to initialize
@param array $options Set of options to pass to the constructor
@return WebserviceInterface
@throws \Muffin\Webservice\Exception\MissingWebserviceClassException If no webservice class can be found
Creates a Webservice instance .