class MarkupNormalizer
Same name in other branches
- 8.9.x core/modules/serialization/src/Normalizer/MarkupNormalizer.php \Drupal\serialization\Normalizer\MarkupNormalizer
- 10 core/modules/serialization/src/Normalizer/MarkupNormalizer.php \Drupal\serialization\Normalizer\MarkupNormalizer
- 11.x core/modules/serialization/src/Normalizer/MarkupNormalizer.php \Drupal\serialization\Normalizer\MarkupNormalizer
Normalizes MarkupInterface objects into a string.
Hierarchy
- class \Drupal\serialization\Normalizer\NormalizerBase implements \Symfony\Component\Serializer\SerializerAwareInterface, \Drupal\serialization\Normalizer\CacheableNormalizerInterface, \Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface uses \Symfony\Component\Serializer\SerializerAwareTrait
- class \Drupal\serialization\Normalizer\MarkupNormalizer extends \Drupal\serialization\Normalizer\NormalizerBase
Expanded class hierarchy of MarkupNormalizer
1 string reference to 'MarkupNormalizer'
- serialization.services.yml in core/
modules/ serialization/ serialization.services.yml - core/modules/serialization/serialization.services.yml
1 service uses MarkupNormalizer
- serializer.normalizer.safe_string in core/
modules/ serialization/ serialization.services.yml - Drupal\serialization\Normalizer\MarkupNormalizer
File
-
core/
modules/ serialization/ src/ Normalizer/ MarkupNormalizer.php, line 10
Namespace
Drupal\serialization\NormalizerView source
class MarkupNormalizer extends NormalizerBase {
/**
* {@inheritdoc}
*/
protected $supportedInterfaceOrClass = MarkupInterface::class;
/**
* {@inheritdoc}
*/
public function normalize($object, $format = NULL, array $context = []) {
return (string) $object;
}
/**
* {@inheritdoc}
*/
public function hasCacheableSupportsMethod() : bool {
return TRUE;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
CacheableNormalizerInterface::SERIALIZATION_CONTEXT_CACHEABILITY | constant | Name of key for bubbling cacheability metadata via serialization context. | |||
MarkupNormalizer::$supportedInterfaceOrClass | protected | property | The interface or class that this Normalizer supports. | Overrides NormalizerBase::$supportedInterfaceOrClass | |
MarkupNormalizer::hasCacheableSupportsMethod | public | function | Overrides NormalizerBase::hasCacheableSupportsMethod | ||
MarkupNormalizer::normalize | public | function | |||
NormalizerBase::$format | protected | property | List of formats which supports (de-)normalization. | 3 | |
NormalizerBase::addCacheableDependency | protected | function | Adds cacheability if applicable. | ||
NormalizerBase::checkFormat | protected | function | Checks if the provided format is supported by this normalizer. | 1 | |
NormalizerBase::supportsDenormalization | public | function | Implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface::supportsDenormalization() | 1 | |
NormalizerBase::supportsNormalization | public | function | 1 |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.