You are here

public function ResourceResponse::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/rest/src/ResourceResponse.php \Drupal\rest\ResourceResponse::__construct()

Constructor for ResourceResponse objects.

Parameters

mixed $data: Response data that should be serialized.

int $status: The response status code.

array $headers: An array of response headers.

Overrides Response::__construct

File

core/modules/rest/src/ResourceResponse.php, line 43
Contains \Drupal\rest\ResourceResponse.

Class

ResourceResponse
Contains data for serialization before sending the response.

Namespace

Drupal\rest

Code

public function __construct($data = NULL, $status = 200, $headers = array()) {
  $this->responseData = $data;
  parent::__construct('', $status, $headers);
}