You are here

protected function BibtexEncoder::buildLine in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_bibtex/src/Encoder/BibtexEncoder.php \Drupal\bibcite_bibtex\Encoder\BibtexEncoder::buildLine()

Build entry line.

Parameters

string $key: Line key.

string|array $value: Line value.

Return value

string Entry line.

1 call to BibtexEncoder::buildLine()
BibtexEncoder::buildEntry in modules/bibcite_bibtex/src/Encoder/BibtexEncoder.php
Build BibTeX entry string.

File

modules/bibcite_bibtex/src/Encoder/BibtexEncoder.php, line 198

Class

BibtexEncoder
BibTeX format encoder.

Namespace

Drupal\bibcite_bibtex\Encoder

Code

protected function buildLine($key, $value) {
  switch ($key) {
    case 'author':
      $value = implode(' and ', $value);
      break;
    case 'keywords':
      $value = implode(', ', $value);
      break;
  }
  return '  ' . $key . ' = {' . $value . '},' . "\n";
}