You are here

public function ReferenceNormalizerBase::setFormat in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/src/Normalizer/ReferenceNormalizerBase.php \Drupal\bibcite_entity\Normalizer\ReferenceNormalizerBase::setFormat()

Format setter for DI calls.

Parameters

string|array $format: Normalizer format.

File

modules/bibcite_entity/src/Normalizer/ReferenceNormalizerBase.php, line 44

Class

ReferenceNormalizerBase
Base normalizer class for bibcite formats.

Namespace

Drupal\bibcite_entity\Normalizer

Code

public function setFormat($format) {
  $this->format = $format;
  foreach ((array) $this->format as $format) {
    $config_name = sprintf('bibcite_entity.mapping.%s', $format);
    $config = $this->configFactory
      ->get($config_name);
    $this->fieldsMapping[$format] = $config
      ->get('fields');
    $this->typesMapping[$format] = $config
      ->get('types');
  }
}