protected function ConfigEntityDenormalizer::prepareInput in JSON:API 8.2
Prepares the input data to create the entity.
Parameters
array $data: The input data to modify.
\Drupal\jsonapi\ResourceType\ResourceType $resource_type: Contains the info about the resource type.
string $format: Format the given data was extracted from.
array $context: Options available to the denormalizer.
Return value
array The modified input data.
Overrides EntityDenormalizerBase::prepareInput
File
- src/
Normalizer/ ConfigEntityDenormalizer.php, line 27
Class
- ConfigEntityDenormalizer
- Converts the Drupal config entity object to a JSON:API array structure.
Namespace
Drupal\jsonapi\NormalizerCode
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;
}