You are here

public function CacheableNormalization::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/src/Normalizer/Value/CacheableNormalization.php \Drupal\jsonapi\Normalizer\Value\CacheableNormalization::__construct()
  2. 10 core/modules/jsonapi/src/Normalizer/Value/CacheableNormalization.php \Drupal\jsonapi\Normalizer\Value\CacheableNormalization::__construct()

CacheableNormalization constructor.

Parameters

\Drupal\Core\Cache\CacheableDependencyInterface $cacheability: The cacheability metadata for the normalized data.

array|string|int|float|bool|null $normalization: The normalized data. This value must not contain any CacheableNormalizations.

1 call to CacheableNormalization::__construct()
CacheableOmission::__construct in core/modules/jsonapi/src/Normalizer/Value/CacheableOmission.php
CacheableOmission constructor.
1 method overrides CacheableNormalization::__construct()
CacheableOmission::__construct in core/modules/jsonapi/src/Normalizer/Value/CacheableOmission.php
CacheableOmission constructor.

File

core/modules/jsonapi/src/Normalizer/Value/CacheableNormalization.php, line 39

Class

CacheableNormalization
Use to store normalized data and its cacheability.

Namespace

Drupal\jsonapi\Normalizer\Value

Code

public function __construct(CacheableDependencyInterface $cacheability, $normalization) {
  assert(is_array($normalization) && static::hasNoNestedInstances($normalization) || is_string($normalization) || is_int($normalization) || is_float($normalization) || is_bool($normalization) || is_null($normalization));
  $this->normalization = $normalization;
  $this
    ->setCacheability($cacheability);
}