File tree 1 file changed +2
-3
lines changed
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -12,21 +12,20 @@ Creating a New Normalizer
12
12
Imagine you want add, modify, or remove some properties during the serialization
13
13
process. For that you'll have to create your own normalizer. But it's usually
14
14
preferable to let Symfony normalize the object, then hook into the normalization
15
- to customize the normalized data. To do that, leverage the `` ObjectNormalizer `` ::
15
+ to customize the normalized data.::
16
16
17
17
// src/Serializer/TopicNormalizer.php
18
18
namespace App\Serializer;
19
19
20
20
use App\Entity\Topic;
21
21
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
22
22
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
23
- use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
24
23
25
24
class TopicNormalizer implements NormalizerInterface
26
25
{
27
26
public function __construct(
28
27
private UrlGeneratorInterface $router,
29
- private ObjectNormalizer $normalizer,
28
+ private NormalizerInterface $normalizer,
30
29
) {
31
30
}
32
31
You can’t perform that action at this time.
0 commit comments