abstract class NormalizerBase in Drupal 8
Same name in this branch
- 8 core/modules/jsonapi/src/Normalizer/NormalizerBase.php \Drupal\jsonapi\Normalizer\NormalizerBase
- 8 core/modules/hal/src/Normalizer/NormalizerBase.php \Drupal\hal\Normalizer\NormalizerBase
- 8 core/modules/serialization/src/Normalizer/NormalizerBase.php \Drupal\serialization\Normalizer\NormalizerBase
Same name and namespace in other branches
- 9 core/modules/hal/src/Normalizer/NormalizerBase.php \Drupal\hal\Normalizer\NormalizerBase
Base class for Normalizers.
Hierarchy
- class \Drupal\serialization\Normalizer\NormalizerBase implements \Symfony\Component\Serializer\SerializerAwareInterface, CacheableNormalizerInterface uses \Symfony\Component\Serializer\SerializerAwareTrait
- class \Drupal\hal\Normalizer\NormalizerBase implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface
Expanded class hierarchy of NormalizerBase
File
- core/
modules/ hal/ src/ Normalizer/ NormalizerBase.php, line 11
Namespace
Drupal\hal\NormalizerView source
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);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableNormalizerInterface:: |
constant | Name of key for bubbling cacheability metadata via serialization context. | ||
NormalizerBase:: |
protected | property |
List of formats which supports (de-)normalization. Overrides NormalizerBase:: |
|
NormalizerBase:: |
protected | property | The interface or class that this Normalizer supports. | 22 |
NormalizerBase:: |
protected | function | Adds cacheability if applicable. | |
NormalizerBase:: |
protected | function |
Checks if the provided format is supported by this normalizer. Overrides NormalizerBase:: |
|
NormalizerBase:: |
public | function | Implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface::supportsDenormalization() | 1 |
NormalizerBase:: |
public | function | Checks whether the given class is supported for normalization by this normalizer. | 1 |