You are here

protected function EndnoteEncoder::buildEntry 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::buildEntry()

Build tagged entry string.

Parameters

array $data: Array of tagged values.

Return value

string Formatted tagged string.

1 call to EndnoteEncoder::buildEntry()
EndnoteEncoder::encodeTagged in modules/bibcite_endnote/src/Encoder/EndnoteEncoder.php
Encode tagged format function.

File

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

Class

EndnoteEncoder
Endnote format encoder.

Namespace

Drupal\bibcite_endnote\Encoder

Code

protected function buildEntry(array $data) {
  $config = \Drupal::config('bibcite_entity.mapping.tagged');
  $indexes = $config
    ->get('indexes');
  $entry = NULL;

  // For not duplicating pages parse.
  $pages_parsed = FALSE;
  foreach ($data as $key => $value) {
    if (is_array($value)) {
      if (isset($indexes[$key])) {
        $entry .= $this
          ->buildMultiLine($indexes[$key], $value);
      }
    }
    else {
      if (isset($indexes[$key])) {
        $entry .= $this
          ->buildLine($indexes[$key], $value);
      }
    }
  }
  return $entry;
}