You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
new Serializer([new ArrayDenormalizer(), new DateTimeNormalizer(), new ObjectNormalizer()], [new JsonEncoder()])
50
+
new Serializer([new BackedEnumNormalizer(), new DateTimeNormalizer(), new ArrayDenormalizer(), new ObjectNormalizer()], [new JsonEncoder()])
50
51
);
51
52
}
52
53
@@ -215,7 +216,6 @@ For using the built-in type mapper:
215
216
);
216
217
```
217
218
218
-
219
219
### Limitations when updating nested properties
220
220
221
221
Due to how Doctrine works, it will not detect changes to nested objects or properties.
@@ -292,21 +292,23 @@ class Kernel extends BaseKernel
292
292
293
293
**How can I add additional normalizers?**
294
294
295
-
The Symfony Serializer is easily extensible. This bundle registers and uses a service with ID `dunglas_doctrine_json_odm.serializer` as the serializer for the JSON type. This means we can easily override it in our `services.yaml` to use additional normalizers.
296
-
As an example we use the Symfony `DateTimeNormalizer` service, so we do have support for any property that is an instance of `\DateTimeInterface`. Be aware that the order of the normalizers might be relevant depending on the normalizers you use.
295
+
The Symfony Serializer is easily extensible. This bundle registers and uses a service with ID `dunglas_doctrine_json_odm.serializer` as the serializer for the JSON type.
296
+
This means we can easily override it in our `services.yaml` to use additional normalizers.
297
+
As an example we inject a custom normalizer service. Be aware that the order of the normalizers might be relevant depending on the normalizers you use.
297
298
298
299
```yaml
299
300
# Add DateTime Normalizer to Dunglas' Doctrine JSON ODM Bundle
As a side note: If you happen to use [Autowiring](https://symfony.com/doc/current/service_container/autowiring.html) in your `services.yaml` you might need to set `autowire: false` too. Same goes for `autoconfigure: false` in case you're using [Autoconfiguration](https://symfony.com/doc/current/service_container.html#the-autoconfigure-option).
309
-
310
312
**When the namespace of a used entity changes**
311
313
312
314
For classes without [type aliases](#using-type-aliases), because we store the `#type` along with the data in the database, you have to migrate the already existing data in your database to reflect the new namespace.
@@ -322,7 +324,7 @@ WHERE 'AppBundle\\\Entity\\\Bar' = JSON_EXTRACT(misc, '$."#type"');
322
324
323
325
## Credits
324
326
325
-
This bundle is brought to you by [Kévin Dunglas](https://dunglas.fr) and [awesome contributors](https://github.com/dunglas/doctrine-json-odm/graphs/contributors).
327
+
This bundle is brought to you by [Kévin Dunglas](https://dunglas.dev) and [awesome contributors](https://github.com/dunglas/doctrine-json-odm/graphs/contributors).
326
328
Sponsored by [Les-Tilleuls.coop](https://les-tilleuls.coop).
0 commit comments