You are here

private function EndnoteEncoder::addKeywords in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_endnote/src/Encoder/EndnoteEncoder.php \Drupal\bibcite_endnote\Encoder\EndnoteEncoder::addKeywords()

Add keywords to xml.

Parameters

\SimpleXMLElement $xml: Parent XmlElement.

mixed $ref: Our reference.

array $indexes: Mapping indexes.

1 call to EndnoteEncoder::addKeywords()
EndnoteEncoder::encode in modules/bibcite_endnote/src/Encoder/EndnoteEncoder.php

File

modules/bibcite_endnote/src/Encoder/EndnoteEncoder.php, line 300

Class

EndnoteEncoder
Endnote format encoder.

Namespace

Drupal\bibcite_endnote\Encoder

Code

private function addKeywords(&$xml, &$ref, $indexes, $keyword_key) {
  foreach ($ref as $key => $value) {
    switch ($key) {
      case 'keywords':
        foreach ($ref[$key] as $keyword) {
          $this
            ->addTag($xml, $keyword_key, $keyword);
        }
        unset($ref[$key]);
        break;
    }
  }
}