function ResourceResponseSubscriber::getSubscribedEvents

Same name in this branch
  1. 10 core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php \Drupal\rest\EventSubscriber\ResourceResponseSubscriber::getSubscribedEvents()
Same name in other branches
  1. 9 core/modules/jsonapi/src/EventSubscriber/ResourceResponseSubscriber.php \Drupal\jsonapi\EventSubscriber\ResourceResponseSubscriber::getSubscribedEvents()
  2. 9 core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php \Drupal\rest\EventSubscriber\ResourceResponseSubscriber::getSubscribedEvents()
  3. 8.9.x core/modules/jsonapi/src/EventSubscriber/ResourceResponseSubscriber.php \Drupal\jsonapi\EventSubscriber\ResourceResponseSubscriber::getSubscribedEvents()
  4. 8.9.x core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php \Drupal\rest\EventSubscriber\ResourceResponseSubscriber::getSubscribedEvents()
  5. 11.x core/modules/jsonapi/src/EventSubscriber/ResourceResponseSubscriber.php \Drupal\jsonapi\EventSubscriber\ResourceResponseSubscriber::getSubscribedEvents()
  6. 11.x core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php \Drupal\rest\EventSubscriber\ResourceResponseSubscriber::getSubscribedEvents()

See also

\Drupal\rest\EventSubscriber\ResourceResponseSubscriber::getSubscribedEvents()

\Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber

File

core/modules/jsonapi/src/EventSubscriber/ResourceResponseSubscriber.php, line 64

Class

ResourceResponseSubscriber
Response subscriber that serializes and removes ResourceResponses' data.

Namespace

Drupal\jsonapi\EventSubscriber

Code

public static function getSubscribedEvents() : array {
    // Run before the dynamic page cache subscriber (priority 100), so that
    // Dynamic Page Cache can cache flattened responses.
    $events[KernelEvents::RESPONSE][] = [
        'onResponse',
        128,
    ];
    return $events;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.