Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
added function
Browse files Browse the repository at this point in the history
  • Loading branch information
yeniatencio committed May 9, 2024
1 parent 2dea92e commit 747ca83
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/EventSubscriber/TideSiteResourceObjectNormalizationCacher.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,28 @@ protected function set(ResourceObject $object, array $normalization_parts) {

$this->renderCache->set($data_as_render_array, $base);
}
/**
* Generates a lookup render array for a normalization.
*
* @param \Drupal\jsonapi\JsonApiResource\ResourceObject $object
* The resource object for which to generate a cache item.
*
* @return array
* A render array for use with the RenderCache service.
*
* @see \Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber::$dynamicPageCacheRedirectRenderArray
*/
protected static function generateLookupRenderArray(ResourceObject $object) {
return [
'#cache' => [
'keys' => [
$object->getResourceType()
->getTypeName(),
$object->getId(),
],
'bin' => 'jsonapi_normalizations',
],
];
}

}

0 comments on commit 747ca83

Please sign in to comment.