You are here

EndnoteReferenceNormalizer.php in Bibliography & Citation 2.0.x

File

modules/bibcite_endnote/src/Normalizer/EndnoteReferenceNormalizer.php
View source
<?php

namespace Drupal\bibcite_endnote\Normalizer;

use Drupal\bibcite_entity\Entity\ReferenceInterface;
use Drupal\bibcite_entity\Normalizer\ReferenceNormalizerBase;

/**
 * Normalizes/denormalizes reference entity to Endnote format.
 */
class EndnoteReferenceNormalizer extends ReferenceNormalizerBase {

  /**
   * {@inheritdoc}
   */
  protected function extractFields(ReferenceInterface $reference, $format) {
    $attributes = parent::extractFields($reference, $format);
    $attributes['title'] = $this
      ->extractScalar($reference
      ->get('title'));
    return $attributes;
  }

}

Classes

Namesort descending Description
EndnoteReferenceNormalizer Normalizes/denormalizes reference entity to Endnote format.