class BlockContentNormalizer in Fixed Block Content 8
Block content normalizer to store as fixed content block default value.
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
- class \Drupal\hal\Normalizer\ContentEntityNormalizer uses DeprecatedServicePropertyTrait, FieldableEntityNormalizerTrait
- class \Drupal\fixed_block_content\Normalizer\BlockContentNormalizer
- class \Drupal\hal\Normalizer\ContentEntityNormalizer uses DeprecatedServicePropertyTrait, FieldableEntityNormalizerTrait
- class \Drupal\hal\Normalizer\NormalizerBase implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface
Expanded class hierarchy of BlockContentNormalizer
1 string reference to 'BlockContentNormalizer'
1 service uses BlockContentNormalizer
File
- src/
Normalizer/ BlockContentNormalizer.php, line 10
Namespace
Drupal\fixed_block_content\NormalizerView source
class BlockContentNormalizer extends ContentEntityNormalizer {
/**
* The interface or class that this Normalizer supports.
*
* @var string
*/
protected $supportedInterfaceOrClass = 'Drupal\\block_content\\Entity\\BlockContent';
/**
* {@inheritdoc}
*/
public function normalize($object, $format = NULL, array $context = []) {
$attributes = parent::normalize($object, $format, $context);
if (isset($context['fixed_block_content'])) {
// Remove local entity IDs.
$ids = [
'id',
'revision_id',
'uuid',
'changed',
'revision_created',
'revision_user',
];
foreach ($ids as $id) {
unset($attributes[$id]);
}
}
return $attributes;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlockContentNormalizer:: |
protected | property |
The interface or class that this Normalizer supports. Overrides ContentEntityNormalizer:: |
|
BlockContentNormalizer:: |
public | function |
Normalizes an object into a set of arrays/scalars. Overrides ContentEntityNormalizer:: |
|
CacheableNormalizerInterface:: |
constant | Name of key for bubbling cacheability metadata via serialization context. | ||
ContentEntityNormalizer:: |
protected | property | ||
ContentEntityNormalizer:: |
protected | property | The hypermedia link manager. | |
ContentEntityNormalizer:: |
protected | property | The module handler. | |
ContentEntityNormalizer:: |
public | function | Implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface::denormalize(). | |
ContentEntityNormalizer:: |
protected | function | Constructs the entity URI. | 1 |
ContentEntityNormalizer:: |
protected | function | Gets the typed data IDs for a type URI. | |
ContentEntityNormalizer:: |
public | function | Constructs an ContentEntityNormalizer object. | 1 |
DeprecatedServicePropertyTrait:: |
public | function | Allows to access deprecated/removed properties. | |
FieldableEntityNormalizerTrait:: |
protected | property | The entity field manager. | |
FieldableEntityNormalizerTrait:: |
protected | property | The entity type manager. | 1 |
FieldableEntityNormalizerTrait:: |
protected | property | The entity type repository. | |
FieldableEntityNormalizerTrait:: |
protected | function | Build the field item value using the incoming data. | 7 |
FieldableEntityNormalizerTrait:: |
protected | function | Denormalizes entity data by denormalizing each field individually. | |
FieldableEntityNormalizerTrait:: |
protected | function | Determines the entity type ID to denormalize as. | |
FieldableEntityNormalizerTrait:: |
protected | function | Denormalizes the bundle property so entity creation can use it. | |
FieldableEntityNormalizerTrait:: |
protected | function | Returns the entity field manager. | |
FieldableEntityNormalizerTrait:: |
protected | function | Gets the entity type definition. | |
FieldableEntityNormalizerTrait:: |
protected | function | Returns the entity type manager. | |
FieldableEntityNormalizerTrait:: |
protected | function | Returns the entity type repository. | |
NormalizerBase:: |
protected | property |
List of formats which supports (de-)normalization. Overrides NormalizerBase:: |
|
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 |