public function init(
        $name,
        $requestType,
        $responseType,
        $responseWrapper,
        $method,
        $urlBuildMethod,
        $baseUrl,
        $port,
        array $parameters,
        array $addsOn = array(),
        array $requestHeaders = array()
    ) {
        // Setting object fields
        $this->name             = $name;
        $this->requestType      = $requestType;
        $this->responseType     = $responseType;
        $this->responseWrapper  = $responseWrapper;
        $this->uriBuildMethod   = $urlBuildMethod;
        $this->parameters       = $parameters;
        $this->baseUrl          = rtrim($baseUrl, '/');
        $this->port             = $port;
        $this->addsOn           = $addsOn;
        $this->requestHeaders   = $requestHeaders;

        // Configuring parent object field
        $this->setMethod($method);
        $this->setPort($this->port);

        // Setting headers from header array
        if (count($requestHeaders) > 0) {
            $this->getHeaders()->addHeaders($requestHeaders);
        }
    }
public function init(
        $name,
        $requestType,
        $responseType,
        $responseWrapper,
        $method,
        $urlBuildMethod,
        $baseUrl,
        $port,
        array $parameters,
        array $addsOn = array(),
        array $requestHeaders = array()
    ) {
        // Setting object fields
        $this->name             = $name;
        $this->requestType      = $requestType;
        $this->responseType     = $responseType;
        $this->responseWrapper  = $responseWrapper;
        $this->uriBuildMethod   = $urlBuildMethod;
        $this->parameters       = $parameters;
        $this->baseUrl          = rtrim($baseUrl, '/');
        $this->port             = $port;
        $this->addsOn           = $addsOn;
        $this->requestHeaders   = $requestHeaders;

        // Configuring parent object field
        $this->setMethod($method);
        $this->setPort($this->port);

        // Setting headers from header array
        if (count($requestHeaders) > 0) {
            $this->getHeaders()->addHeaders($requestHeaders);
        }
    }
public function init ( $ name , $ requestType , $ responseType , $ responseWrapper , $ method , $ urlBuildMethod , $ baseUrl , $ port , array $ parameters , array $ addsOn = array ( ) , array $ requestHeaders = array ( ) ) { // Setting object fields $ this -> name = $ name ; $ this -> requestType = $ requestType ; $ this -> responseType = $ responseType ; $ this -> responseWrapper = $ responseWrapper ; $ this -> uriBuildMethod = $ urlBuildMethod ; $ this -> parameters = $ parameters ; $ this -> baseUrl = rtrim ( $ baseUrl , '/' ) ; $ this -> port = $ port ; $ this -> addsOn = $ addsOn ; $ this -> requestHeaders = $ requestHeaders ; // Configuring parent object field $ this -> setMethod ( $ method ) ; $ this -> setPort ( $ this -> port ) ; // Setting headers from header array if ( count ( $ requestHeaders ) > 0 ) { $ this -> getHeaders ( ) -> addHeaders ( $ requestHeaders ) ; } }
Initializes a request object

@param string $name              the action name
@param string $requestType       the request type: class name of the request type object; if no full namespace and class is not found, we use the given name plus the default request namespace plus, eventually, the default request class name suffix.
@param string $responseType      the response type: class name of the response type object; if no full namespace and class is not found, we use the given name plus the default response namespace plus, eventually, the default response class name suffix.
@param string $responseWrapper   the response wrapper: full class name of the response wrapper object
@param string $method            the http method (only POST and GET are supported)
@param string $urlBuildMethod    the url build method: constant that indicates how the url request is build (see implementing classes for more details)
@param string $baseUrl           the API base url
@param string $port              the API port
@param array  $parameters        the API call parameters array
@param array  $addsOn            the URL adds on array (list of strings to be added to the base url according to their type)
@param array  $requestHeaders    the request headers with their default values


@return mixed
Initializes a request object