Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1217

Remind users to include __pclass field in projections

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.5.1
    • Affects Version/s: None
    • Component/s: Docs
    • None

      Deserialization from BSON includes a helpful comment:

      Make sure you include the field "__pclass" to the projection if you want the ODM to automatically call the bsonUnserialize of the class.

      If you don't get that field in the query, the ODM will never know which class to call, so you'll have to specify it with the "typemap" variable.

      We should note this in the documentation and perhaps add a note to the projection option docs in Query::__construct().

            Assignee:
            derick Derick Rethans
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: