array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'class.mongodb-bson-persistable.php', 1 => 'MongoDB\\BSON\\Persistable', ), 'up' => array ( 0 => 'book.bson.php', 1 => 'MongoDB\\BSON', ), 'prev' => array ( 0 => 'class.mongodb-bson-type.php', 1 => 'MongoDB\\BSON\\Type', ), 'next' => array ( 0 => 'mongodb-bson-persistable.bsonserialize.php', 1 => 'MongoDB\\BSON\\Persistable::bsonSerialize', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/mongodb/bson/persistable.xml', ), 'extra_header_links' => array ( 'rel' => 'alternate', 'href' => '/manual/en/feeds/class.mongodb-bson-persistable.atom', 'type' => 'application/atom+xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(mongodb >=1.0.0)
Classes may implement this interface to take advantage of automatic ODM (object document mapping) behavior in the driver. During serialization, the driver will inject a __pclass property containing the PHP class name into the data returned by MongoDB\BSON\Serializable::bsonSerialize(). During unserialization, the same __pclass property will then be used to infer the PHP class (independent of any type map configuration) to be constructed before MongoDB\BSON\Unserializable::bsonUnserialize() is invoked. See Persisting Data for additional information.
Bilginize: Even if MongoDB\BSON\Serializable::bsonSerialize() would return a sequential array, injection of the __pclass property will cause the object to be serialized as a BSON document.