protected function RISReferenceNormalizer::extractFields in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x modules/bibcite_ris/src/Normalizer/RISReferenceNormalizer.php \Drupal\bibcite_ris\Normalizer\RISReferenceNormalizer::extractFields()
Extract fields values from reference entity.
Parameters
\Drupal\bibcite_entity\Entity\ReferenceInterface $reference: Reference entity object.
string $format: Serializer format.
Return value
array Array of entity values.
Overrides ReferenceNormalizerBase::extractFields
File
- modules/
bibcite_ris/ src/ Normalizer/ RISReferenceNormalizer.php, line 16
Class
- RISReferenceNormalizer
- Normalizes/denormalizes reference entity to RIS format.
Namespace
Drupal\bibcite_ris\NormalizerCode
protected function extractFields(ReferenceInterface $reference, $format) {
$attributes = parent::extractFields($reference, $format);
$isbn = $this
->extractScalar($reference
->get('bibcite_isbn'));
$issn = $this
->extractScalar($reference
->get('bibcite_issn'));
if ($isbn || $issn) {
$attributes['SN'] = trim($isbn . '/' . $issn, '/');
}
return $attributes;
}