You are here

protected function NormalizerBase::checkFormat in Drupal 8

Same name in this branch
  1. 8 core/modules/jsonapi/src/Normalizer/NormalizerBase.php \Drupal\jsonapi\Normalizer\NormalizerBase::checkFormat()
  2. 8 core/modules/hal/src/Normalizer/NormalizerBase.php \Drupal\hal\Normalizer\NormalizerBase::checkFormat()
  3. 8 core/modules/serialization/src/Normalizer/NormalizerBase.php \Drupal\serialization\Normalizer\NormalizerBase::checkFormat()

Checks if the provided format is supported by this normalizer.

Parameters

string $format: The format to check.

Return value

bool TRUE if the format is supported, FALSE otherwise. If no format is specified this will return TRUE.

Overrides NormalizerBase::checkFormat

File

core/modules/hal/src/Normalizer/NormalizerBase.php, line 21

Class

NormalizerBase
Base class for Normalizers.

Namespace

Drupal\hal\Normalizer

Code

protected function checkFormat($format = NULL) {
  if (isset($this->formats)) {
    @trigger_error('::formats is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Use ::$format instead. See https://www.drupal.org/node/2868275', E_USER_DEPRECATED);
    $this->format = $this->formats;
  }
  return parent::checkFormat($format);
}