You are here

public function FieldItemNormalizerValue::rasterizeValue in JSON:API 8

1 call to FieldItemNormalizerValue::rasterizeValue()
RelationshipItemNormalizerValue::rasterizeValue in src/Normalizer/Value/RelationshipItemNormalizerValue.php
Get the rasterized value.
2 methods override FieldItemNormalizerValue::rasterizeValue()
ConfigFieldItemNormalizerValue::rasterizeValue in src/Normalizer/Value/ConfigFieldItemNormalizerValue.php
RelationshipItemNormalizerValue::rasterizeValue in src/Normalizer/Value/RelationshipItemNormalizerValue.php
Get the rasterized value.

File

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

Class

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

Namespace

Drupal\jsonapi\Normalizer\Value

Code

public function rasterizeValue() {

  // If there is only one property, then output it directly.
  $value = count($this->raw) == 1 ? reset($this->raw) : $this->raw;
  return $this
    ->rasterizeValueRecursive($value);
}