You are here

class ModifiedResourceResponse in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/rest/src/ModifiedResourceResponse.php \Drupal\rest\ModifiedResourceResponse
  2. 9 core/modules/rest/src/ModifiedResourceResponse.php \Drupal\rest\ModifiedResourceResponse

A response that does not contain cacheability metadata.

Used when resources are modified by a request: responses to unsafe requests (POST/PATCH/DELETE) can never be cached.

Hierarchy

  • class \Drupal\rest\ModifiedResourceResponse extends \Symfony\Component\HttpFoundation\Response implements \Drupal\rest\ResourceResponseInterface uses \Drupal\rest\ResourceResponseTrait

Expanded class hierarchy of ModifiedResourceResponse

See also

\Drupal\rest\ResourceResponse

4 files declare their use of ModifiedResourceResponse
EntityResource.php in core/modules/rest/src/Plugin/rest/resource/EntityResource.php
FileUploadResource.php in core/modules/file/src/Plugin/rest/resource/FileUploadResource.php
ResourceResponseSubscriberTest.php in core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php
UserRegistrationResource.php in core/modules/user/src/Plugin/rest/resource/UserRegistrationResource.php

File

core/modules/rest/src/ModifiedResourceResponse.php, line 15

Namespace

Drupal\rest
View source
class ModifiedResourceResponse extends Response implements ResourceResponseInterface {
  use ResourceResponseTrait;

  /**
   * Constructor for ModifiedResourceResponse objects.
   *
   * @param mixed $data
   *   Response data that should be serialized.
   * @param int $status
   *   The response status code.
   * @param array $headers
   *   An array of response headers.
   */
  public function __construct($data = NULL, $status = 200, $headers = []) {
    $this->responseData = $data;
    parent::__construct('', $status, $headers);
  }

}

Members