You are here

protected function ReferenceNormalizerBase::convertFormatType in Bibliography & Citation 2.0.x

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

Convert format type to publication type.

Parameters

string $type: Format publication type.

string $format: Serializer format.

Return value

null|string Bibcite entity publication type.

1 call to ReferenceNormalizerBase::convertFormatType()
ReferenceNormalizerBase::denormalize in modules/bibcite_entity/src/Normalizer/ReferenceNormalizerBase.php

File

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

Class

ReferenceNormalizerBase
Base normalizer class for bibcite formats.

Namespace

Drupal\bibcite_entity\Normalizer

Code

protected function convertFormatType($type, $format) {
  if (isset($this->typesMapping[$format][$type])) {
    return $this->typesMapping[$format][$type];
  }
  elseif (isset($this->typesMapping[$format][$this->defaultType])) {
    return $this->typesMapping[$format][$this->defaultType];
  }
  return self::DEFAULT_REF_TYPE;
}