public function getActionRequestByName($actionName)
    {
        // If action name level separator is in the string, we split
        $actionNameFirstPart = $actionNameSecondPart = "";
        if (strpos($actionName, self::API_NAME_LEVEL_SEPARATOR) === 0) {
            throw new BadApiConfigurationException(
                sprintf(
                    '[%s] Action name \'%s\' is not well formed. It should contain two parts separated by \'%s\'.',
                    $actionName,
                    self::API_NAME_LEVEL_SEPARATOR,
                    $this->getApiName()
                )
            );
        } else {
            $actionParts = explode(self::API_NAME_LEVEL_SEPARATOR, $actionName);
            if (isset($actionParts[0]) && isset($actionParts[1])) {
                $actionNameFirstPart  = $actionParts[0];
                $actionNameSecondPart = $actionParts[1];
            }
        }

        // Action is configured?
        if (!isset($this->actions[$actionNameFirstPart][$actionNameSecondPart])) {
            if ($this->getInitAllActions()) {
                throw new NotConfiguredActionException(
                    sprintf(
                        '[%s] No action configured with the following name: %s%s%s. Given action name was: %s',
                        $this->getApiName(),
                        $actionNameFirstPart,
                        self::API_NAME_LEVEL_SEPARATOR,
                        $actionNameSecondPart,
                        $actionName
                    ),
                    $actionName
                );
            } else {
                // We check if the requested action has a configuration
                if (!isset($this->actionsConfig[$actionNameFirstPart])
                    && !isset($this->actionsConfig[$actionNameFirstPart][$actionNameSecondPart])
                ) {
                    throw new NotConfiguredActionException(
                        sprintf(
                            '[%s] No action configuration found for the following action name: %s',
                            $this->getApiName(),
                            $actionName
                        ),
                        $actionName
                    );
                }

                // If configuration is found, then we create the action
                $this->setActionRequest(
                    $this->actionsConfig[$actionNameFirstPart][$actionNameSecondPart],
                    $actionNameFirstPart,
                    $actionNameSecondPart,
                    $this->actionsCommonConfig
                );
            }
        }

        // Returning action object
        return $this->actions[$actionNameFirstPart][$actionNameSecondPart];
    }
public function getActionRequestByName($actionName)
    {
        // If action name level separator is in the string, we split
        $actionNameFirstPart = $actionNameSecondPart = "";
        if (strpos($actionName, self::API_NAME_LEVEL_SEPARATOR) === 0) {
            throw new BadApiConfigurationException(
                sprintf(
                    '[%s] Action name \'%s\' is not well formed. It should contain two parts separated by \'%s\'.',
                    $actionName,
                    self::API_NAME_LEVEL_SEPARATOR,
                    $this->getApiName()
                )
            );
        } else {
            $actionParts = explode(self::API_NAME_LEVEL_SEPARATOR, $actionName);
            if (isset($actionParts[0]) && isset($actionParts[1])) {
                $actionNameFirstPart  = $actionParts[0];
                $actionNameSecondPart = $actionParts[1];
            }
        }

        // Action is configured?
        if (!isset($this->actions[$actionNameFirstPart][$actionNameSecondPart])) {
            if ($this->getInitAllActions()) {
                throw new NotConfiguredActionException(
                    sprintf(
                        '[%s] No action configured with the following name: %s%s%s. Given action name was: %s',
                        $this->getApiName(),
                        $actionNameFirstPart,
                        self::API_NAME_LEVEL_SEPARATOR,
                        $actionNameSecondPart,
                        $actionName
                    ),
                    $actionName
                );
            } else {
                // We check if the requested action has a configuration
                if (!isset($this->actionsConfig[$actionNameFirstPart])
                    && !isset($this->actionsConfig[$actionNameFirstPart][$actionNameSecondPart])
                ) {
                    throw new NotConfiguredActionException(
                        sprintf(
                            '[%s] No action configuration found for the following action name: %s',
                            $this->getApiName(),
                            $actionName
                        ),
                        $actionName
                    );
                }

                // If configuration is found, then we create the action
                $this->setActionRequest(
                    $this->actionsConfig[$actionNameFirstPart][$actionNameSecondPart],
                    $actionNameFirstPart,
                    $actionNameSecondPart,
                    $this->actionsCommonConfig
                );
            }
        }

        // Returning action object
        return $this->actions[$actionNameFirstPart][$actionNameSecondPart];
    }
public function getActionRequestByName ( $ actionName ) { // If action name level separator is in the string, we split $ actionNameFirstPart = $ actionNameSecondPart = "" ; if ( strpos ( $ actionName , self :: API_NAME_LEVEL_SEPARATOR ) === 0 ) { throw new BadApiConfigurationException ( sprintf ( '[%s] Action name \'%s\' is not well formed. It should contain two parts separated by \'%s\'.' , $ actionName , self :: API_NAME_LEVEL_SEPARATOR , $ this -> getApiName ( ) ) ) ; } else { $ actionParts = explode ( self :: API_NAME_LEVEL_SEPARATOR , $ actionName ) ; if ( isset ( $ actionParts [ 0 ] ) && isset ( $ actionParts [ 1 ] ) ) { $ actionNameFirstPart = $ actionParts [ 0 ] ; $ actionNameSecondPart = $ actionParts [ 1 ] ; } } // Action is configured? if ( ! isset ( $ this -> actions [ $ actionNameFirstPart ] [ $ actionNameSecondPart ] ) ) { if ( $ this -> getInitAllActions ( ) ) { throw new NotConfiguredActionException ( sprintf ( '[%s] No action configured with the following name: %s%s%s. Given action name was: %s' , $ this -> getApiName ( ) , $ actionNameFirstPart , self :: API_NAME_LEVEL_SEPARATOR , $ actionNameSecondPart , $ actionName ) , $ actionName ) ; } else { // We check if the requested action has a configuration if ( ! isset ( $ this -> actionsConfig [ $ actionNameFirstPart ] ) && ! isset ( $ this -> actionsConfig [ $ actionNameFirstPart ] [ $ actionNameSecondPart ] ) ) { throw new NotConfiguredActionException ( sprintf ( '[%s] No action configuration found for the following action name: %s' , $ this -> getApiName ( ) , $ actionName ) , $ actionName ) ; } // If configuration is found, then we create the action $ this -> setActionRequest ( $ this -> actionsConfig [ $ actionNameFirstPart ] [ $ actionNameSecondPart ] , $ actionNameFirstPart , $ actionNameSecondPart , $ this -> actionsCommonConfig ) ; } } // Returning action object return $ this -> actions [ $ actionNameFirstPart ] [ $ actionNameSecondPart ] ; }
Returns a ActionRequestInterface instance by action name

@param string $actionName the action name

@throws \Msl\RemoteHost\Exception\NotConfiguredActionException
@throws \Msl\RemoteHost\Exception\BadApiConfigurationException

@return mixed
Returns a ActionRequestInterface instance by action name