From dedcfce8054c8fa03b8b6cecab4b467410d59781 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Thu, 17 Dec 2015 21:57:19 +0000 Subject: [PATCH] Update BSON docs for MongoDB driver git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@338287 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mongodb/bson/binary/construct.xml | 43 ++++----- reference/mongodb/bson/binary/getdata.xml | 92 +++++++++++++++++++ reference/mongodb/bson/binary/gettype.xml | 92 +++++++++++++++++++ .../mongodb/bson/javascript/construct.xml | 56 ++++++----- reference/mongodb/bson/maxkey.xml | 8 +- .../getsubtype.xml => maxkey/construct.xml} | 38 +++----- reference/mongodb/bson/minkey.xml | 4 + reference/mongodb/bson/minkey/construct.xml | 85 +++++++++++++++++ reference/mongodb/bson/objectid/construct.xml | 42 +++++---- reference/mongodb/bson/objectid/tostring.xml | 23 ++--- reference/mongodb/bson/regex/construct.xml | 41 ++++----- reference/mongodb/bson/regex/getflags.xml | 21 ++--- reference/mongodb/bson/regex/getpattern.xml | 21 ++--- reference/mongodb/bson/regex/tostring.xml | 23 +++-- .../bson/serializable/bsonserialize.xml | 2 +- reference/mongodb/bson/timestamp.xml | 4 +- .../mongodb/bson/timestamp/construct.xml | 43 ++++----- reference/mongodb/bson/timestamp/tostring.xml | 21 ++--- reference/mongodb/bson/utcdatetime.xml | 8 +- .../mongodb/bson/utcdatetime/construct.xml | 43 +++++---- .../mongodb/bson/utcdatetime/todatetime.xml | 25 ++--- .../mongodb/bson/utcdatetime/tostring.xml | 27 +++--- reference/mongodb/versions.xml | 5 +- 23 files changed, 521 insertions(+), 246 deletions(-) create mode 100644 reference/mongodb/bson/binary/getdata.xml create mode 100644 reference/mongodb/bson/binary/gettype.xml rename reference/mongodb/bson/{binary/getsubtype.xml => maxkey/construct.xml} (60%) create mode 100644 reference/mongodb/bson/minkey/construct.xml diff --git a/reference/mongodb/bson/binary/construct.xml b/reference/mongodb/bson/binary/construct.xml index 3f0ce53572..97a3c30f53 100644 --- a/reference/mongodb/bson/binary/construct.xml +++ b/reference/mongodb/bson/binary/construct.xml @@ -4,56 +4,47 @@ MongoDB\BSON\Binary::__construct - Description + Construct a new Binary &reftitle.description; - public MongoDB\BSON\Binary::__construct + final public MongoDB\BSON\Binary::__construct stringdata - stringsubtype + integertype - - &reftitle.parameters; - data + data (string) - + Binary data. - subtype + type (integer) - + Binary type. - - &reftitle.returnvalues; - - - - - &reftitle.errors; - - - + + &mongodb.throws.argumentparsing; + @@ -65,15 +56,21 @@ ]]> - &example.outputs.similar; + &example.outputs; + string(3) "foo" + ["type"]=> + int(0) +} ]]> @@ -83,7 +80,7 @@ &reftitle.seealso; - + BSON Types diff --git a/reference/mongodb/bson/binary/getdata.xml b/reference/mongodb/bson/binary/getdata.xml new file mode 100644 index 0000000000..11616a8725 --- /dev/null +++ b/reference/mongodb/bson/binary/getdata.xml @@ -0,0 +1,92 @@ + + + + + + MongoDB\BSON\Binary::getData + Returns the Binary's data + + + + &reftitle.description; + + final public stringMongoDB\BSON\Binary::getData + + + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the Binary's data + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Binary::getData</function> example + +getData()); + +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/binary/gettype.xml b/reference/mongodb/bson/binary/gettype.xml new file mode 100644 index 0000000000..0a2d0d6934 --- /dev/null +++ b/reference/mongodb/bson/binary/gettype.xml @@ -0,0 +1,92 @@ + + + + + + MongoDB\BSON\Binary::getType + Returns the Binary's type + + + + &reftitle.description; + + final public integerMongoDB\BSON\Binary::getType + + + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the Binary's type. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Binary::getType</function> example + +getType()); + +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/javascript/construct.xml b/reference/mongodb/bson/javascript/construct.xml index 64e388769b..764b1037b3 100644 --- a/reference/mongodb/bson/javascript/construct.xml +++ b/reference/mongodb/bson/javascript/construct.xml @@ -4,56 +4,47 @@ MongoDB\BSON\Javascript::__construct - Description + Construct a new Javascript &reftitle.description; final public MongoDB\BSON\Javascript::__construct - stringjavascript - stringscope + stringcode + array|objectscope - - &reftitle.parameters; - javascript + code (string) - + Javascript code. - scope + scope (array|object) - + Javascript scope. - - &reftitle.returnvalues; - - - - - &reftitle.errors; - - - + + &mongodb.throws.argumentparsing; + @@ -65,15 +56,34 @@ 'bar']); +var_dump($codews); ?> ]]> - &example.outputs.similar; + &example.outputs; + string(24) "function() { return 1; }" + ["scope"]=> + object(stdClass)#2 (0) { + } +} +object(MongoDB\BSON\Javascript)#2 (2) { + ["javascript"]=> + string(26) "function() { return foo; }" + ["scope"]=> + object(stdClass)#1 (1) { + ["foo"]=> + string(3) "bar" + } +} ]]> @@ -83,7 +93,7 @@ &reftitle.seealso; - + BSON Types diff --git a/reference/mongodb/bson/maxkey.xml b/reference/mongodb/bson/maxkey.xml index ab6bce4c42..75e11fa473 100644 --- a/reference/mongodb/bson/maxkey.xml +++ b/reference/mongodb/bson/maxkey.xml @@ -1,6 +1,6 @@ - - + + The MongoDB\BSON\MaxKey class @@ -36,6 +36,8 @@ + &Methods; + @@ -43,6 +45,8 @@ + &reference.mongodb.bson.entities.maxkey; + + - + - MongoDB\BSON\Binary::getSubType - Description + MongoDB\BSON\MaxKey::__construct + Construct a new MaxKey &reftitle.description; - public ReturnTypeMongoDB\BSON\Binary::getSubType - + final public MongoDB\BSON\MaxKey::__construct + - - @@ -24,38 +22,32 @@ &no.function.parameters; - - &reftitle.returnvalues; - - - - - &reftitle.errors; - - - + + &mongodb.throws.argumentparsing; + &reftitle.examples; - <function>MongoDB\BSON\Binary::getSubType</function> example + <function>MongoDB\BSON\MaxKey::__construct</function> example ]]> - &example.outputs.similar; + &example.outputs; @@ -65,7 +57,7 @@ &reftitle.seealso; - + BSON Types diff --git a/reference/mongodb/bson/minkey.xml b/reference/mongodb/bson/minkey.xml index eca75b1dbe..5cadd9bd88 100644 --- a/reference/mongodb/bson/minkey.xml +++ b/reference/mongodb/bson/minkey.xml @@ -36,6 +36,8 @@ + &Methods; + @@ -43,6 +45,8 @@ + &reference.mongodb.bson.entities.minkey; + + + + + MongoDB\BSON\MinKey::__construct + Construct a new MinKey + + + + &reftitle.description; + + final public MongoDB\BSON\MinKey::__construct + + + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\MinKey::__construct</function> example + + +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/objectid/construct.xml b/reference/mongodb/bson/objectid/construct.xml index 3a04ed4c14..35112668c9 100644 --- a/reference/mongodb/bson/objectid/construct.xml +++ b/reference/mongodb/bson/objectid/construct.xml @@ -4,47 +4,40 @@ MongoDB\BSON\ObjectID::__construct - Description + Construct a new ObjectID &reftitle.description; - public MongoDB\BSON\ObjectID::__construct + final public MongoDB\BSON\ObjectID::__construct stringid - - &reftitle.parameters; - id + id (string) - + A 24-character hexadecimal string. If not provided, the driver will + generate an ObjectID. - - &reftitle.returnvalues; - - - - - &reftitle.errors; - - - + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\InvalidArgumentException if id is not a 24-character hexadecimal string. + @@ -56,7 +49,9 @@ ]]> @@ -64,7 +59,15 @@ &example.outputs.similar; + string(24) "56732d3dda14d81214634921" +} +object(MongoDB\BSON\ObjectID)#1 (1) { + ["oid"]=> + string(24) "000000000000000000000001" +} + ]]> @@ -74,7 +77,8 @@ &reftitle.seealso; - + ObjectID Reference + BSON Types: ObjectID diff --git a/reference/mongodb/bson/objectid/tostring.xml b/reference/mongodb/bson/objectid/tostring.xml index 8710ab88d1..6ba99f6a94 100644 --- a/reference/mongodb/bson/objectid/tostring.xml +++ b/reference/mongodb/bson/objectid/tostring.xml @@ -4,19 +4,17 @@ MongoDB\BSON\ObjectID::__toString - Description + Returns the hexidecimal representation of this ObjectID &reftitle.description; - public ReturnTypeMongoDB\BSON\ObjectID::__toString + final public stringMongoDB\BSON\ObjectID::__toString - - @@ -27,15 +25,15 @@ &reftitle.returnvalues; - + Returns the hexidecimal representation of this ObjectID. &reftitle.errors; - - - + + &mongodb.throws.argumentparsing; + @@ -47,7 +45,8 @@ ]]> @@ -55,7 +54,8 @@ &example.outputs.similar; @@ -65,7 +65,8 @@ &reftitle.seealso; - + ObjectID Reference + BSON Types: ObjectID diff --git a/reference/mongodb/bson/regex/construct.xml b/reference/mongodb/bson/regex/construct.xml index d02742a077..8c40d8c663 100644 --- a/reference/mongodb/bson/regex/construct.xml +++ b/reference/mongodb/bson/regex/construct.xml @@ -4,56 +4,47 @@ MongoDB\BSON\Regex::__construct - Description + Construct a new Regex &reftitle.description; - public MongoDB\BSON\Regex::__construct + final public MongoDB\BSON\Regex::__construct stringpattern stringflags - - &reftitle.parameters; - pattern + pattern (string) - + The regular expression pattern. - flags + flags (string) - + The regular expression flags. - - &reftitle.returnvalues; - - - - - &reftitle.errors; - - - + + &mongodb.throws.argumentparsing; + @@ -65,15 +56,21 @@ ]]> - &example.outputs.similar; + &example.outputs; + string(5) "regex" + ["flags"]=> + string(1) "i" +} ]]> @@ -83,7 +80,7 @@ &reftitle.seealso; - + BSON Types diff --git a/reference/mongodb/bson/regex/getflags.xml b/reference/mongodb/bson/regex/getflags.xml index 7a271d6043..8fd26f7ac3 100644 --- a/reference/mongodb/bson/regex/getflags.xml +++ b/reference/mongodb/bson/regex/getflags.xml @@ -4,19 +4,17 @@ MongoDB\BSON\Regex::getFlags - Description + Returns the Regex's flags &reftitle.description; - public ReturnTypeMongoDB\BSON\Regex::getFlags + final public ReturnTypeMongoDB\BSON\Regex::getFlags - - @@ -27,15 +25,15 @@ &reftitle.returnvalues; - + Returns the Regex's flags &reftitle.errors; - - - + + &mongodb.throws.argumentparsing; + @@ -47,7 +45,8 @@ getFlags()); ?> ]]> @@ -55,7 +54,7 @@ &example.outputs.similar; @@ -65,7 +64,7 @@ &reftitle.seealso; - + BSON Types diff --git a/reference/mongodb/bson/regex/getpattern.xml b/reference/mongodb/bson/regex/getpattern.xml index 20f7885eb0..f6b9a4eb30 100644 --- a/reference/mongodb/bson/regex/getpattern.xml +++ b/reference/mongodb/bson/regex/getpattern.xml @@ -4,19 +4,17 @@ MongoDB\BSON\Regex::getPattern - Description + Returns the Regex's pattern &reftitle.description; - public ReturnTypeMongoDB\BSON\Regex::getPattern + final public stringMongoDB\BSON\Regex::getPattern - - @@ -27,15 +25,15 @@ &reftitle.returnvalues; - + Returns the Regex's pattern. &reftitle.errors; - - - + + &mongodb.throws.argumentparsing; + @@ -47,7 +45,8 @@ getPattern()); ?> ]]> @@ -55,7 +54,7 @@ &example.outputs.similar; @@ -65,7 +64,7 @@ &reftitle.seealso; - + BSON Types diff --git a/reference/mongodb/bson/regex/tostring.xml b/reference/mongodb/bson/regex/tostring.xml index 75a16622b0..3d490c7e24 100644 --- a/reference/mongodb/bson/regex/tostring.xml +++ b/reference/mongodb/bson/regex/tostring.xml @@ -4,19 +4,17 @@ MongoDB\BSON\Regex::__toString - Description + Returns the string representation of this Regex &reftitle.description; - public ReturnTypeMongoDB\BSON\Regex::__toString + final public stringMongoDB\BSON\Regex::__toString - - @@ -27,15 +25,15 @@ &reftitle.returnvalues; - + Returns the string representation of this Regex. &reftitle.errors; - - - + + &mongodb.throws.argumentparsing; + @@ -47,15 +45,16 @@ ]]> - &example.outputs.similar; + &example.outputs; @@ -65,7 +64,7 @@ &reftitle.seealso; - + BSON Types diff --git a/reference/mongodb/bson/serializable/bsonserialize.xml b/reference/mongodb/bson/serializable/bsonserialize.xml index ec00004906..d6d009f48b 100644 --- a/reference/mongodb/bson/serializable/bsonserialize.xml +++ b/reference/mongodb/bson/serializable/bsonserialize.xml @@ -162,7 +162,7 @@ echo MongoDB\BSON\toJSON($bson), "\n"; &reftitle.seealso; - MongoDB\BSON\Unzerializable::bsonUnserialize + MongoDB\BSON\Unserializable::bsonUnserialize MongoDB\BSON\Persistable diff --git a/reference/mongodb/bson/timestamp.xml b/reference/mongodb/bson/timestamp.xml index bcd6237c0e..92cfb0a7e5 100644 --- a/reference/mongodb/bson/timestamp.xml +++ b/reference/mongodb/bson/timestamp.xml @@ -12,7 +12,9 @@
&reftitle.intro; - + Represents a + BSON timestamp, + which is an internal MongoDB type not intended for general date storage.
diff --git a/reference/mongodb/bson/timestamp/construct.xml b/reference/mongodb/bson/timestamp/construct.xml index 00fd2a53e8..2db6fcd0f6 100644 --- a/reference/mongodb/bson/timestamp/construct.xml +++ b/reference/mongodb/bson/timestamp/construct.xml @@ -4,56 +4,48 @@ MongoDB\BSON\Timestamp::__construct - Description + Construct a new Timestamp &reftitle.description; final public MongoDB\BSON\Timestamp::__construct - stringincrement - stringtimestamp + integerincrement + integertimestamp - - &reftitle.parameters; - increment + increment (integer) - + 32-bit integer denoting the incrementing ordinal for operations within a + given second. - timestamp + timestamp (integer) - + 32-bit integer denoting seconds since the Unix epoch. - - &reftitle.returnvalues; - - - - - &reftitle.errors; - - - + + &mongodb.throws.argumentparsing; + @@ -65,15 +57,20 @@ ]]> - &example.outputs.similar; + &example.outputs; + int(1234) + ["timestamp"]=> + int(5678) +} ]]> @@ -83,7 +80,7 @@ &reftitle.seealso; - + BSON Types: Timestamps diff --git a/reference/mongodb/bson/timestamp/tostring.xml b/reference/mongodb/bson/timestamp/tostring.xml index dd22cbfa0b..ce602a95cf 100644 --- a/reference/mongodb/bson/timestamp/tostring.xml +++ b/reference/mongodb/bson/timestamp/tostring.xml @@ -4,19 +4,17 @@ MongoDB\BSON\Timestamp::__toString - Description + Returns the string representation of this Timestamp &reftitle.description; - final public ReturnTypeMongoDB\BSON\Timestamp::__toString + final public stringMongoDB\BSON\Timestamp::__toString - - @@ -27,15 +25,15 @@ &reftitle.returnvalues; - + Returns the string representation of this Timestamp. &reftitle.errors; - - - + + &mongodb.throws.argumentparsing; + @@ -47,7 +45,8 @@ ]]> @@ -55,7 +54,7 @@ &example.outputs.similar; @@ -65,7 +64,7 @@ &reftitle.seealso; - + BSON Types: Timestamps diff --git a/reference/mongodb/bson/utcdatetime.xml b/reference/mongodb/bson/utcdatetime.xml index 1d2c5bad16..6ceb50c173 100644 --- a/reference/mongodb/bson/utcdatetime.xml +++ b/reference/mongodb/bson/utcdatetime.xml @@ -3,8 +3,8 @@ - The MongoDB\BSON\UTCDatetime class - MongoDB\BSON\UTCDatetime + The MongoDB\BSON\UTCDateTime class + MongoDB\BSON\UTCDateTime @@ -23,12 +23,12 @@ - MongoDB\BSON\UTCDatetime + MongoDB\BSON\UTCDateTime - MongoDB\BSON\UTCDatetime + MongoDB\BSON\UTCDateTime diff --git a/reference/mongodb/bson/utcdatetime/construct.xml b/reference/mongodb/bson/utcdatetime/construct.xml index 0d62b7e7f0..868020ed62 100644 --- a/reference/mongodb/bson/utcdatetime/construct.xml +++ b/reference/mongodb/bson/utcdatetime/construct.xml @@ -3,60 +3,56 @@ - MongoDB\BSON\UTCDatetime::__construct - Description + MongoDB\BSON\UTCDateTime::__construct + Construct a new UTCDateTime &reftitle.description; - final public MongoDB\BSON\UTCDatetime::__construct - stringmilliseconds + final public MongoDB\BSON\UTCDateTime::__construct + integermilliseconds - - &reftitle.parameters; - milliseconds + milliseconds (integer) - + 64-bit integer that represents the number of milliseconds since the Unix + epoch (Jan 1, 1970). Negative values represent dates before 1970. + + + On 32-bit systems, this parameter may be provided as a string. - - &reftitle.returnvalues; - - - - - &reftitle.errors; - - - + + &mongodb.throws.argumentparsing; + &reftitle.examples; - <function>MongoDB\BSON\UTCDatetime::__construct</function> example + <function>MongoDB\BSON\UTCDateTime::__construct</function> example ]]> @@ -64,7 +60,10 @@ &example.outputs.similar; + int(1416445411987) +} ]]> @@ -74,7 +73,7 @@ &reftitle.seealso; - + BSON Types: Date diff --git a/reference/mongodb/bson/utcdatetime/todatetime.xml b/reference/mongodb/bson/utcdatetime/todatetime.xml index 38205f333d..cef44bf40c 100644 --- a/reference/mongodb/bson/utcdatetime/todatetime.xml +++ b/reference/mongodb/bson/utcdatetime/todatetime.xml @@ -3,20 +3,18 @@ - MongoDB\BSON\UTCDatetime::toDateTime - Description + MongoDB\BSON\UTCDateTime::toDateTime + Returns the DateTime representation of this UTCDateTime &reftitle.description; - final public ReturnTypeMongoDB\BSON\UTCDatetime::toDateTime + final public DateTimeMongoDB\BSON\UTCDateTime::toDateTime - - @@ -27,15 +25,16 @@ &reftitle.returnvalues; - + Returns the DateTime representation of this + UTCDateTime. &reftitle.errors; - - - + + &mongodb.throws.argumentparsing; + @@ -47,7 +46,9 @@ toDateTime(); +var_dump($datetime->format(DATE_RSS)); ?> ]]> @@ -55,7 +56,7 @@ &example.outputs.similar; @@ -65,7 +66,7 @@ &reftitle.seealso; - + BSON Types: Date diff --git a/reference/mongodb/bson/utcdatetime/tostring.xml b/reference/mongodb/bson/utcdatetime/tostring.xml index 8cb282c072..b58b8db2c0 100644 --- a/reference/mongodb/bson/utcdatetime/tostring.xml +++ b/reference/mongodb/bson/utcdatetime/tostring.xml @@ -3,20 +3,18 @@ - MongoDB\BSON\UTCDatetime::__toString - Description + MongoDB\BSON\UTCDateTime::__toString + Returns the string representation of this UTCDateTime &reftitle.description; - final public ReturnTypeMongoDB\BSON\UTCDatetime::__toString + final public stringMongoDB\BSON\UTCDateTime::__toString - - @@ -27,35 +25,36 @@ &reftitle.returnvalues; - + Returns the string representation of this UTCDateTime. &reftitle.errors; - - - + + &mongodb.throws.argumentparsing; + &reftitle.examples; - <function>MongoDB\BSON\UTCDatetime::__toString</function> example + <function>MongoDB\BSON\UTCDateTime::__toString</function> example ]]> - &example.outputs.similar; + &example.outputs; @@ -65,7 +64,7 @@ &reftitle.seealso; - + BSON Types: Date diff --git a/reference/mongodb/versions.xml b/reference/mongodb/versions.xml index d2125761cb..f234377eba 100644 --- a/reference/mongodb/versions.xml +++ b/reference/mongodb/versions.xml @@ -126,14 +126,17 @@ - + + + +