function NormalizerBase::checkFormat

Same name in this branch
  1. 11.x core/modules/serialization/src/Normalizer/NormalizerBase.php \Drupal\serialization\Normalizer\NormalizerBase::checkFormat()
Same name in other branches
  1. 9 core/modules/jsonapi/src/Normalizer/NormalizerBase.php \Drupal\jsonapi\Normalizer\NormalizerBase::checkFormat()
  2. 9 core/modules/serialization/src/Normalizer/NormalizerBase.php \Drupal\serialization\Normalizer\NormalizerBase::checkFormat()
  3. 8.9.x core/modules/jsonapi/src/Normalizer/NormalizerBase.php \Drupal\jsonapi\Normalizer\NormalizerBase::checkFormat()
  4. 8.9.x core/modules/serialization/src/Normalizer/NormalizerBase.php \Drupal\serialization\Normalizer\NormalizerBase::checkFormat()
  5. 8.9.x core/modules/hal/src/Normalizer/NormalizerBase.php \Drupal\hal\Normalizer\NormalizerBase::checkFormat()
  6. 10 core/modules/jsonapi/src/Normalizer/NormalizerBase.php \Drupal\jsonapi\Normalizer\NormalizerBase::checkFormat()
  7. 10 core/modules/serialization/src/Normalizer/NormalizerBase.php \Drupal\serialization\Normalizer\NormalizerBase::checkFormat()

Overrides NormalizerBase::checkFormat

File

core/modules/jsonapi/src/Normalizer/NormalizerBase.php, line 63

Class

NormalizerBase
Base normalizer used in all JSON:API normalizers.

Namespace

Drupal\jsonapi\Normalizer

Code

protected function checkFormat($format = NULL) {
    // The parent implementation allows format-specific normalizers to be used
    // for normalization without a format. The JSON:API module wants to be
    // cautious. Hence it only allows its normalizers to be used for the
    // JSON:API format, to avoid JSON:API-specific normalizations showing up in
    // the REST API.
    return $format === $this->format;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.