You are here

protected function ReferenceNormalizerBase::extractKeywords in Bibliography & Citation 2.0.x

Same name and namespace in other branches
  1. 8 modules/bibcite_entity/src/Normalizer/ReferenceNormalizerBase.php \Drupal\bibcite_entity\Normalizer\ReferenceNormalizerBase::extractKeywords()

Extract keywords labels from field.

Parameters

\Drupal\Core\Field\FieldItemListInterface $field_item_list: List of field items.

Return value

array Keywords labels.

2 calls to ReferenceNormalizerBase::extractKeywords()
BibtexReferenceNormalizer::normalize in modules/bibcite_bibtex/src/Normalizer/BibtexReferenceNormalizer.php
ReferenceNormalizerBase::normalize in modules/bibcite_entity/src/Normalizer/ReferenceNormalizerBase.php

File

modules/bibcite_entity/src/Normalizer/ReferenceNormalizerBase.php, line 280

Class

ReferenceNormalizerBase
Base normalizer class for bibcite formats.

Namespace

Drupal\bibcite_entity\Normalizer

Code

protected function extractKeywords(FieldItemListInterface $field_item_list) {
  $keywords = [];
  foreach ($field_item_list as $field) {
    $keywords[] = $field->entity
      ->label();
  }
  return $keywords;
}