Skip to content

Commit d193e7b

Browse files
committed
Add note linking to codec tutorial in custom-types
1 parent 7366f73 commit d193e7b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/tutorial/custom-types.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ Custom Data-Types
44

55
.. default-domain:: mongodb
66

7+
.. note::
8+
9+
This tutorial explains implementing custom data types using the :php:`MongoDB\\BSON\\Persistable <class.mongodb-bson-persistable>`
10+
interface found in the MongoDB extension. Consider using a codec instead to decouple the MongoDB persistence logic
11+
from your business logic. See the :doc:`Codec tutorial </tutorial/codecs>` for an example.
12+
713
The MongoDB PHP extension and library support custom classes while
814
serializing and deserializing. An example of where this might be useful is
915
if you want to store date/time information retaining the time zone

0 commit comments

Comments
 (0)