ConfigEntityDenormalizer.php in JSON:API 8.2
File
src/Normalizer/ConfigEntityDenormalizer.php
View source
<?php
namespace Drupal\jsonapi\Normalizer;
use Drupal\Core\Config\Entity\ConfigEntityInterface;
use Drupal\jsonapi\ResourceType\ResourceType;
final class ConfigEntityDenormalizer extends EntityDenormalizerBase {
protected $supportedInterfaceOrClass = ConfigEntityInterface::class;
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;
}
}