You are here

protected function TermLevelItemNormalizer::normalizedFieldValues in Term Level Field 8

Normalizes field values for an item.

Parameters

\Drupal\Core\Field\FieldItemInterface $field_item: The field item instance.

string|null $format: The normalization format.

array $context: The context passed into the normalizer.

Return value

array An array of field item values, keyed by property name.

Overrides FieldItemNormalizer::normalizedFieldValues

File

src/Normalizer/TermLevelItemNormalizer.php, line 24

Class

TermLevelItemNormalizer
Converts values for TermLevelItem to and from common formats for hal.

Namespace

Drupal\term_level\Normalizer

Code

protected function normalizedFieldValues(FieldItemInterface $field_item, $format, array $context) {
  $value = parent::normalizedFieldValues($field_item, $format, $context);
  $value['level'] = $field_item->level;
  return $value;
}