protected function CacheableDependencyTrait::setCacheability in JSON:API 8
Sets cacheability; useful for value object constructors.
Parameters
\Drupal\Core\Cache\CacheableDependencyInterface $cacheability: The cacheability to set.
Return value
$this
7 calls to CacheableDependencyTrait::setCacheability()
- EntityNormalizerValue::__construct in src/
Normalizer/ Value/ EntityNormalizerValue.php - Instantiate a EntityNormalizerValue object.
- FieldItemNormalizerValue::__construct in src/
Normalizer/ Value/ FieldItemNormalizerValue.php - Instantiate a FieldItemNormalizerValue object.
- FieldNormalizerValue::__construct in src/
Normalizer/ Value/ FieldNormalizerValue.php - Instantiate a FieldNormalizerValue object.
- IncludeOnlyRelationshipNormalizerValue::__construct in src/
Normalizer/ Value/ IncludeOnlyRelationshipNormalizerValue.php - Instantiate a IncludeOnlyRelationshipNormalizerValue object.
- NullFieldNormalizerValue::__construct in src/
Normalizer/ Value/ NullFieldNormalizerValue.php - Instantiate a FieldNormalizerValue object.
File
- src/
Normalizer/ CacheableDependencyTrait.php, line 45
Class
Namespace
Drupal\jsonapi\NormalizerCode
protected function setCacheability(CacheableDependencyInterface $cacheability) {
$this->cacheContexts = $cacheability
->getCacheContexts();
$this->cacheTags = $cacheability
->getCacheTags();
$this->cacheMaxAge = $cacheability
->getCacheMaxAge();
return $this;
}