public function ResourceResponse::__construct in JSON:API 8
Same name and namespace in other branches
- 8.2 src/ResourceResponse.php \Drupal\jsonapi\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.
File
- src/
ResourceResponse.php, line 42
Class
- ResourceResponse
- Contains data for serialization before sending the response.
Namespace
Drupal\jsonapiCode
public function __construct($data = NULL, $status = 200, array $headers = []) {
$this->responseData = $data;
parent::__construct('', $status, $headers);
}