You are here

public function RestResponse::__construct in Salesforce Suite 5.0.x

Same name and namespace in other branches
  1. 8.4 src/Rest/RestResponse.php \Drupal\salesforce\Rest\RestResponse::__construct()
  2. 8.3 src/Rest/RestResponse.php \Drupal\salesforce\Rest\RestResponse::__construct()

RestResponse constructor.

Parameters

\Psr\Http\Message\ResponseInterface $response: A response.

2 calls to RestResponse::__construct()
RestResponseDescribe::__construct in src/Rest/RestResponseDescribe.php
See https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest....
RestResponseResources::__construct in src/Rest/RestResponseResources.php
RestResponseResources constructor.
2 methods override RestResponse::__construct()
RestResponseDescribe::__construct in src/Rest/RestResponseDescribe.php
See https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest....
RestResponseResources::__construct in src/Rest/RestResponseResources.php
RestResponseResources constructor.

File

src/Rest/RestResponse.php, line 41

Class

RestResponse
Class RestResponse.

Namespace

Drupal\salesforce\Rest

Code

public function __construct(ResponseInterface $response) {
  $this->response = $response;
  parent::__construct($response
    ->getStatusCode(), $response
    ->getHeaders(), $response
    ->getBody(), $response
    ->getProtocolVersion(), $response
    ->getReasonPhrase());
  $this
    ->handleJsonResponse();
}