-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 0.6.3
-
Component/s: None
-
None
Currently, if php_phongo_bson_visit_binary() finds an ODM class (in our special binary field), it will supersede anything specified in the type map for the current document (be it "document" or "root", which may be introduced in PHPC-315).
This means that users ultimately have no control over decoding a document if they would really like a stdClass or array returned (unless they project out the __pclass field).
Per PR #21 for the serialization spec, we agreed that the ODM class should always take priority (as it might with unserialize() in PHP). Users for which this might be a problem would be encouraged to not used __pclass and instead implement their own mapping by specific fields paths in their documents, which we'll introduce in PHPC-314.