You are here

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

Same name and namespace in other branches
  1. 8 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\Encoder

Code

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);
}