public function RISEncoder::encode in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x 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\EncoderCode
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);
}