NormalizerBase.php

Same filename in this branch
  1. 8.9.x core/modules/jsonapi/src/Normalizer/NormalizerBase.php
  2. 8.9.x core/modules/serialization/src/Normalizer/NormalizerBase.php
Same filename in other branches
  1. 9 core/modules/jsonapi/src/Normalizer/NormalizerBase.php
  2. 9 core/modules/serialization/src/Normalizer/NormalizerBase.php
  3. 9 core/modules/hal/src/Normalizer/NormalizerBase.php
  4. 10 core/modules/jsonapi/src/Normalizer/NormalizerBase.php
  5. 10 core/modules/serialization/src/Normalizer/NormalizerBase.php
  6. 11.x core/modules/jsonapi/src/Normalizer/NormalizerBase.php
  7. 11.x core/modules/serialization/src/Normalizer/NormalizerBase.php

Namespace

Drupal\hal\Normalizer

File

core/modules/hal/src/Normalizer/NormalizerBase.php

View source
<?php

namespace Drupal\hal\Normalizer;

use Drupal\serialization\Normalizer\NormalizerBase as SerializationNormalizerBase;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;

/**
 * Base class for Normalizers.
 */
abstract class NormalizerBase extends SerializationNormalizerBase implements DenormalizerInterface {
    
    /**
     * {@inheritdoc}
     */
    protected $format = [
        'hal_json',
    ];
    
    /**
     * {@inheritdoc}
     */
    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);
    }

}

Classes

Title Deprecated Summary
NormalizerBase Base class for Normalizers.

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