Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-239

Unpack MongoDB\BSON\Serializable instances before reading properties

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.1.0
    • Affects Version/s: 1.0.3
    • Component/s: None
    • None

      get_object_vars() returns an empty array for ArrayObject instances (e.g. MongoDB\Model\BSONDocument). This is problematic if such an object is used for an index specification or replacement document.

      We should check if an object implements MongoDB\BSON\Serializable and use the return value of its bsonSerialize() method if so. That is currently done for extract_id_from_inserted_document().

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: