You are here

public function RISEncoder::encode in Bibliography & Citation 2.0.x

Same name and namespace in other branches
  1. 8 modules/bibcite_ris/src/Encoder/RISEncoder.php \Drupal\bibcite_ris\Encoder\RISEncoder::encode()

File

modules/bibcite_ris/src/Encoder/RISEncoder.php, line 179

Class

RISEncoder
RIS format encoder.

Namespace

Drupal\bibcite_ris\Encoder

Code

public function encode($data, $format, array $context = []) {
  if (isset($data['TY'])) {
    $data = [
      $data,
    ];
  }
  $data = array_map(function ($raw) {
    return $this
      ->buildEntry($raw);
  }, $data);
  return implode("\n", $data);
}