class ConfigEntityDenormalizer in JSON:API Extras 8.3
Override ConfigEntityNormalizer to prepare input.
Hierarchy
- class \Drupal\jsonapi_extras\Normalizer\JsonApiNormalizerDecoratorBase implements \Symfony\Component\Serializer\Normalizer\NormalizerInterface, \Symfony\Component\Serializer\Normalizer\DenormalizerInterface, \Symfony\Component\Serializer\SerializerAwareInterface
- class \Drupal\jsonapi_extras\Normalizer\ConfigEntityDenormalizer
Expanded class hierarchy of ConfigEntityDenormalizer
1 file declares its use of ConfigEntityDenormalizer
- ConfigEntityDenormalizerImpostor.php in src-impostor-normalizers/
ConfigEntityDenormalizerImpostor.php
File
- src/
Normalizer/ ConfigEntityDenormalizer.php, line 10
Namespace
Drupal\jsonapi_extras\NormalizerView source
class ConfigEntityDenormalizer extends JsonApiNormalizerDecoratorBase {
/**
* {@inheritdoc}
*/
public function denormalize($data, $class, $format = NULL, array $context = []) {
return parent::denormalize($this
->prepareInput($data, $context['resource_type']), $class, $format, $context);
}
/**
* {@inheritdoc}
*/
protected function prepareInput(array $data, ResourceType $resource_type) {
foreach ($data as $public_field_name => &$field_value) {
/** @var \Drupal\jsonapi_extras\Plugin\ResourceFieldEnhancerInterface $enhancer */
$enhancer = $resource_type
->getFieldEnhancer($public_field_name);
if (!$enhancer) {
continue;
}
$field_value = $enhancer
->transform($field_value);
}
return $data;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigEntityDenormalizer:: |
public | function |
Denormalizes data back into an object of the given class. Overrides JsonApiNormalizerDecoratorBase:: |
|
ConfigEntityDenormalizer:: |
protected | function | ||
JsonApiNormalizerDecoratorBase:: |
protected | property | The decorated (de)normalizer. | |
JsonApiNormalizerDecoratorBase:: |
public | function | Normalizes an object into a set of arrays/scalars. | 3 |
JsonApiNormalizerDecoratorBase:: |
public | function | Sets the owning Serializer object. | |
JsonApiNormalizerDecoratorBase:: |
public | function | Checks whether the given class is supported for denormalization by this normalizer. | |
JsonApiNormalizerDecoratorBase:: |
public | function | Checks whether the given class is supported for normalization by this normalizer. | |
JsonApiNormalizerDecoratorBase:: |
public | function | JsonApiNormalizerDecoratorBase constructor. | 2 |