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

Remind users to include __pclass field in projections

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • 1.5.1
    • Docs
    • None

    Description

      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().

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: