Commit cc14abc7 authored by Jeremy Mikola's avatar Jeremy Mikola

PHPLIB-235: Document BSON model classes

parent 3495dc9e
...@@ -19,12 +19,36 @@ BSON spec, see `bsonspec.org <http://bsonspec.org/>`_. ...@@ -19,12 +19,36 @@ BSON spec, see `bsonspec.org <http://bsonspec.org/>`_.
By default, the |php-library| returns BSON documents as By default, the |php-library| returns BSON documents as
:phpclass:`MongoDB\\Model\\BSONDocument` objects and BSON arrays as :phpclass:`MongoDB\\Model\\BSONDocument` objects and BSON arrays as
:phpclass:`MongoDB\\Model\\BSONArray` objects. :phpclass:`MongoDB\\Model\\BSONArray` objects, respectively.
:phpclass:`BSONDocument <MongoDB\\Model\\BSONDocument>` and
:phpclass:`BSONArray <MongoDB\\Model\\BSONArray>` extend PHP's BSON Classes
:php:`ArrayObject <arrayobject>` class and implement the driver's ------------
:php:`MongoDB\\BSON\\Serializable <mongodb-bson-serializable>` and
:php:`MongoDB\\BSON\\Unserializable <mongodb-bson-unserializable>` interfaces. .. phpclass:: MongoDB\\Model\\BSONArray
This class extends PHP's :php:`ArrayObject <arrayobject>` class. It also
implements PHP's :php:`JsonSerializable <jsonserializable>` interface and the
driver's :php:`MongoDB\\BSON\\Serializable <mongodb-bson-serializable>` and
:php:`MongoDB\\BSON\\Unserializable <mongodb-bson-unserializable>`
interfaces.
By default, the library will deserialize BSON arrays as instances of this
class. During BSON and JSON serialization, instances of this class will
serialize as an array type (:php:`array_values() <array_values>` is used
internally to numerically reindex the array).
.. phpclass:: MongoDB\\Model\\BSONDocument
This class extends PHP's :php:`ArrayObject <arrayobject>` class. It also
implements PHP's :php:`JsonSerializable <jsonserializable>` interface and the
driver's :php:`MongoDB\\BSON\\Serializable <mongodb-bson-serializable>` and
:php:`MongoDB\\BSON\\Unserializable <mongodb-bson-unserializable>`
interfaces.
By default, the library will deserialize BSON documents as instances of this
class. During BSON and JSON serialization, instances of this class will
serialize as a document type (:php:`object casting
<types.type-juggling#language.types.typecasting>` is used internally).
Type Maps Type Maps
--------- ---------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment