You are here

protected static function ResourceObjectNormalizationCacher::generateLookupRenderArray in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/src/EventSubscriber/ResourceObjectNormalizationCacher.php \Drupal\jsonapi\EventSubscriber\ResourceObjectNormalizationCacher::generateLookupRenderArray()
  2. 10 core/modules/jsonapi/src/EventSubscriber/ResourceObjectNormalizationCacher.php \Drupal\jsonapi\EventSubscriber\ResourceObjectNormalizationCacher::generateLookupRenderArray()

Generates a lookup render array for a normalization.

Parameters

\Drupal\jsonapi\JsonApiResource\ResourceObject $object: The resource object for which to generate a cache item.

Return value

array A render array for use with the RenderCache service.

See also

\Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber::$dynamicPageCacheRedirectRenderArray

2 calls to ResourceObjectNormalizationCacher::generateLookupRenderArray()
ResourceObjectNormalizationCacher::get in core/modules/jsonapi/src/EventSubscriber/ResourceObjectNormalizationCacher.php
Reads an entity normalization from cache.
ResourceObjectNormalizationCacher::set in core/modules/jsonapi/src/EventSubscriber/ResourceObjectNormalizationCacher.php
Writes a normalization to cache.

File

core/modules/jsonapi/src/EventSubscriber/ResourceObjectNormalizationCacher.php, line 164

Class

ResourceObjectNormalizationCacher
Caches entity normalizations after the response has been sent.

Namespace

Drupal\jsonapi\EventSubscriber

Code

protected static function generateLookupRenderArray(ResourceObject $object) {
  return [
    '#cache' => [
      'keys' => [
        $object
          ->getResourceType()
          ->getTypeName(),
        $object
          ->getId(),
      ],
      'bin' => 'jsonapi_normalizations',
    ],
  ];
}