diff options
| author | polo <ordipolo@gmx.fr> | 2026-10-18 00:08:23 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-10-18 00:10:03 +0200 |
| commit | 05e38eadbeb3de19e5b26003c2b401e00bb71df4 (patch) | |
| tree | cf48350b69cfce92de6f3a0e03eb0876931c7077 /vendor/doctrine/collections/docs/en/serialization.rst | |
| parent | 32843e50aa981f190bdb4fbc9adbeacc06fdf775 (diff) | |
| download | AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.gz AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.bz2 AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.zip | |
sortie de vendor du dépôt, oubli dans config-template.ini
Diffstat (limited to 'vendor/doctrine/collections/docs/en/serialization.rst')
| -rw-r--r-- | vendor/doctrine/collections/docs/en/serialization.rst | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/vendor/doctrine/collections/docs/en/serialization.rst b/vendor/doctrine/collections/docs/en/serialization.rst deleted file mode 100644 index be53d6e..0000000 --- a/vendor/doctrine/collections/docs/en/serialization.rst +++ /dev/null | |||
| @@ -1,29 +0,0 @@ | |||
| 1 | Serialization | ||
| 2 | ============= | ||
| 3 | |||
| 4 | Using (un-)serialize() on a collection is not a supported use-case | ||
| 5 | and may break when changes on the collection's internals happen in the future. | ||
| 6 | If a collection needs to be serialized, use ``toArray()`` and reconstruct | ||
| 7 | the collection manually. | ||
| 8 | |||
| 9 | .. code-block:: php | ||
| 10 | |||
| 11 | $collection = new ArrayCollection([1, 2, 3]); | ||
| 12 | $serialized = serialize($collection->toArray()); | ||
| 13 | |||
| 14 | A reconstruction is also necessary when the collection contains objects with | ||
| 15 | infinite recursion of dependencies like in this ``json_serialize()`` example: | ||
| 16 | |||
| 17 | .. code-block:: php | ||
| 18 | |||
| 19 | $foo = new Foo(); | ||
| 20 | $bar = new Bar(); | ||
| 21 | |||
| 22 | $foo->setBar($bar); | ||
| 23 | $bar->setFoo($foo); | ||
| 24 | |||
| 25 | $collection = new ArrayCollection([$foo]); | ||
| 26 | $json = json_serialize($collection->toArray()); // recursion detected | ||
| 27 | |||
| 28 | Serializer libraries can be used to create the serialization-output to prevent | ||
| 29 | errors. | ||
