From 5edccbfa808a98cc9801d90ef19cd3e64dbf3fdc Mon Sep 17 00:00:00 2001 From: Ian Kevin Irlen Date: Thu, 12 Jun 2025 14:19:43 +0400 Subject: [PATCH] Update custom_normalizer.rst --- serializer/custom_normalizer.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/serializer/custom_normalizer.rst b/serializer/custom_normalizer.rst index 9c037f7f33c..4e78d9d394e 100644 --- a/serializer/custom_normalizer.rst +++ b/serializer/custom_normalizer.rst @@ -38,14 +38,14 @@ normalization process:: public function normalize(mixed $data, ?string $format = null, array $context = []): array { - $data = $this->normalizer->normalize($data, $format, $context); + $normalizedData = $this->normalizer->normalize($data, $format, $context); // Here, add, edit, or delete some data: - $data['href']['self'] = $this->router->generate('topic_show', [ - 'id' => $object->getId(), + $normalizedData['href']['self'] = $this->router->generate('topic_show', [ + 'id' => $data->getId(), ], UrlGeneratorInterface::ABSOLUTE_URL); - return $data; + return $normalizedData; } public function supportsNormalization($data, ?string $format = null, array $context = []): bool