class ConfigEntityDenormalizer
Same name in other branches
- 9 core/modules/jsonapi/src/Normalizer/ConfigEntityDenormalizer.php \Drupal\jsonapi\Normalizer\ConfigEntityDenormalizer
- 8.9.x core/modules/jsonapi/src/Normalizer/ConfigEntityDenormalizer.php \Drupal\jsonapi\Normalizer\ConfigEntityDenormalizer
- 10 core/modules/jsonapi/src/Normalizer/ConfigEntityDenormalizer.php \Drupal\jsonapi\Normalizer\ConfigEntityDenormalizer
Converts the Drupal config entity object to a JSON:API array structure.
@internal JSON:API maintains no PHP API since its API is the HTTP API. This class may change at any time and this will break any dependencies on it.
Hierarchy
- class \Drupal\jsonapi\Normalizer\ConfigEntityDenormalizer extends \Drupal\jsonapi\Normalizer\EntityDenormalizerBase
Expanded class hierarchy of ConfigEntityDenormalizer
See also
https://www.drupal.org/project/drupal/issues/3032787
1 string reference to 'ConfigEntityDenormalizer'
- jsonapi.services.yml in core/
modules/ jsonapi/ jsonapi.services.yml - core/modules/jsonapi/jsonapi.services.yml
1 service uses ConfigEntityDenormalizer
File
-
core/
modules/ jsonapi/ src/ Normalizer/ ConfigEntityDenormalizer.php, line 17
Namespace
Drupal\jsonapi\NormalizerView source
final class ConfigEntityDenormalizer extends EntityDenormalizerBase {
/**
* {@inheritdoc}
*/
protected function prepareInput(array $data, ResourceType $resource_type, $format, array $context) {
$prepared = [];
foreach ($data as $key => $value) {
$prepared[$resource_type->getInternalName($key)] = $value;
}
return $prepared;
}
/**
* {@inheritdoc}
*/
public function getSupportedTypes(?string $format) : array {
return [
ConfigEntityInterface::class => TRUE,
];
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.