mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
normalization for docgen:read: add groups and so on (wip)
This commit is contained in:
@@ -210,7 +210,17 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
|
||||
$value = $this->propertyAccess->getValue($object, $attribute->getName());
|
||||
$key = $attribute->getSerializedName() ?? $attribute->getName();
|
||||
|
||||
if (is_object($value)) {
|
||||
if (is_iterable($value)) {
|
||||
$arr = [];
|
||||
foreach ($value as $k => $v) {
|
||||
$arr[$k] =
|
||||
$this->normalizer->normalize($v, $format, array_merge(
|
||||
$context,
|
||||
$attribute->getNormalizationContextForGroups($expectedGroups)
|
||||
));
|
||||
}
|
||||
$data[$key] = $arr;
|
||||
} elseif (is_object($value)) {
|
||||
$data[$key] =
|
||||
$this->normalizer->normalize($value, $format, array_merge(
|
||||
$context,
|
||||
|
Reference in New Issue
Block a user