You are here

public function FieldItemNormalizerValue::__construct in JSON:API 8

Instantiate a FieldItemNormalizerValue object.

Parameters

array $values: The normalized result.

\Drupal\Core\Cache\CacheableDependencyInterface $values_cacheability: The cacheability of the normalized result. This cacheability is not part of $values because field items are normalized by Drupal core's serialization system, which was never designed with cacheability in mind. FieldItemNormalizer::normalize() must catch the out-of-band bubbled cacheability and then passes it to this value object.

See also

\Drupal\jsonapi\Normalizer\FieldItemNormalizer::normalize()

1 call to FieldItemNormalizerValue::__construct()
RelationshipItemNormalizerValue::__construct in src/Normalizer/Value/RelationshipItemNormalizerValue.php
Instantiates a RelationshipItemNormalizerValue object.
2 methods override FieldItemNormalizerValue::__construct()
ConfigFieldItemNormalizerValue::__construct in src/Normalizer/Value/ConfigFieldItemNormalizerValue.php
Instantiate a ConfigFieldItemNormalizerValue object.
RelationshipItemNormalizerValue::__construct in src/Normalizer/Value/RelationshipItemNormalizerValue.php
Instantiates a RelationshipItemNormalizerValue object.

File

src/Normalizer/Value/FieldItemNormalizerValue.php, line 38

Class

FieldItemNormalizerValue
Helps normalize field items in compliance with the JSON API spec.

Namespace

Drupal\jsonapi\Normalizer\Value

Code

public function __construct(array $values, CacheableDependencyInterface $values_cacheability) {
  $this->raw = $values;
  $this
    ->setCacheability($values_cacheability);
}