public function MarcEncoder::encode in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x modules/bibcite_marc/src/Encoder/MarcEncoder.php \Drupal\bibcite_marc\Encoder\MarcEncoder::encode()
File
- modules/
bibcite_marc/ src/ Encoder/ MarcEncoder.php, line 280
Class
- MarcEncoder
- Marc format encoder.
Namespace
Drupal\bibcite_marc\EncoderCode
public function encode($data, $format, array $context = []) {
if (isset($data['type'])) {
$data = [
$data,
];
}
$data = array_map(function ($raw) {
return $this
->buildEntry($raw);
}, $data);
return implode("", $data);
}