ModifiedResourceResponse.php 860 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Drupal\rest;
  3. use Symfony\Component\HttpFoundation\Response;
  4. /**
  5. * A response that does not contain cacheability metadata.
  6. *
  7. * Used when resources are modified by a request: responses to unsafe requests
  8. * (POST/PATCH/DELETE) can never be cached.
  9. *
  10. * @see \Drupal\rest\ResourceResponse
  11. */
  12. class ModifiedResourceResponse extends Response implements ResourceResponseInterface {
  13. use ResourceResponseTrait;
  14. /**
  15. * Constructor for ModifiedResourceResponse objects.
  16. *
  17. * @param mixed $data
  18. * Response data that should be serialized.
  19. * @param int $status
  20. * The response status code.
  21. * @param array $headers
  22. * An array of response headers.
  23. */
  24. public function __construct($data = NULL, $status = 200, $headers = []) {
  25. $this->responseData = $data;
  26. parent::__construct('', $status, $headers);
  27. }
  28. }