Results of 1 - 10 of about 16 for bsonSerialize (0.001 sec.)
- MongoDB\Driver\ReadConcern::bsonSerialize — Returns an object for BSON serializ... 11332
- MongoDB\Driver\ReadConcern::bsonSerialize (mongodb >=1.2.0) MongoDB\Driver\ReadConcern::bsonSerialize — Returns an object for BSON serialization 説明 final public function MongoDB\Driver\ReadConcern::bsonSerialize (): stdClass パラメータ こ
... 例外 Throws MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors. 例 例1 MongoDB\Driver\ReadConcern::bsonSerialize() with empty read concern <?php $rc = new MongoDB\Driver\ReadConcern ; var_dump ( $rc -> bsonSerialize ()); echo "\n" , Mo ... JSON (); ?> 上の例の出力は、 たとえば以下のようになります。 object(stdClass)#2 (0) { } { } 例2 MongoDB\Driver\ReadConcern::bsonSerialize() with local read concern <?php $rc = new MongoDB\Driver\ReadConcern ( MongoDB\Driver\ReadConcern :: LOCAL ); var_dump ( $ ... rc -> bsonSerialize ()); echo "\n" , MongoDB\BSON\Document :: fromPHP ( $rc )-> toRelaxedExtendedJSON (); ?> 上の例の出力は、 たとえば以下のよ ...
-
https://man.mtool.work/php/8.3/mongodb-driver-readconcern.bsonserialize.html
- MongoDB\Driver\ReadPreference::bsonSerialize — Returns an object for BSON seria... 11124
- MongoDB\Driver\ReadPreference::bsonSerialize (mongodb >=1.2.0) MongoDB\Driver\ReadPreference::bsonSerialize — Returns an object for BSON serialization 説明 final public function MongoDB\Driver\ReadPreference::bsonSerialize (): stdClass パラ
... Throws MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors. 例 例1 MongoDB\Driver\ReadPreference::bsonSerialize() with primary read preference <?php $rp = new MongoDB\Driver\ReadPreference ( MongoDB\Driver\ReadPreference :: PRIMARY ); ... var_dump ( $rp -> bsonSerialize ()); echo "\n" , MongoDB\BSON\Document :: fromPHP ( $rp )-> toRelaxedExtendedJSON (); ?> 上の例の出力は、 たとえば以下のよ ... ります。 object(stdClass)#2 (1) { ["mode"]=> string(7) "primary" } { "mode" : "primary" } 例2 MongoDB\Driver\ReadPreference::bsonSerialize() with secondary read preference and tag sets <?php $rp = new MongoDB\Driver\ReadPreference ( MongoDB\Driver\ReadPreferenc ...
-
https://man.mtool.work/php/8.3/mongodb-driver-readpreference.bsonserialize.html
- MongoDB\Driver\WriteConcern::bsonSerialize — Returns an object for BSON seriali... 11055
- MongoDB\Driver\WriteConcern::bsonSerialize (mongodb >=1.2.0) MongoDB\Driver\WriteConcern::bsonSerialize — Returns an object for BSON serialization 説明 final public function MongoDB\Driver\WriteConcern::bsonSerialize (): stdClass パラメータ
... 外 Throws MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors. 例 例1 MongoDB\Driver\WriteConcern::bsonSerialize() with majority write concern <?php $wc = new MongoDB\Driver\WriteConcern ( MongoDB\Driver\WriteConcern :: MAJORITY ); var ... _dump ( $wc -> bsonSerialize ()); echo "\n" , MongoDB\BSON\Document :: fromPHP ( $wc )-> toRelaxedExtendedJSON (); ?> 上の例の出力は、 たとえば以下のよ ... うになります。 object(stdClass)#2 (1) { ["w"]=> string(8) "majority" } { "w" : "majority" } 例2 MongoDB\Driver\WriteConcern::bsonSerialize() with wtimeout and journal <?php $wc = new MongoDB\Driver\WriteConcern ( 2 , 1000 , true ); var_dump ( $wc -> bsonSeriali ...
-
https://man.mtool.work/php/8.3/mongodb-driver-writeconcern.bsonserialize.html
- MongoDB\BSON\Serializable::bsonSerialize — Provides an array or document to ser... 10795
- MongoDB\BSON\Serializable::bsonSerialize (mongodb >=1.0.0) MongoDB\BSON\Serializable::bsonSerialize — Provides an array or document to serialize as BSON 説明 abstract public function MongoDB\BSON\Serializable::bsonSerialize (): array | stdC
... tored as root documents. They are stored as arrays when used as an embedded field value. 例 例1 MongoDB\BSON\Serializable::bsonSerialize() returning an associative array for root document <?php class MyDocument implements MongoDB\BSON\Serializable { private $ ... id ; function __construct () { $this -> id = new MongoDB\BSON\ObjectId ; } function bsonSerialize (): array { return [ '_id' => $this -> id , 'foo' => 'bar' ]; } } echo MongoDB\BSON\Document :: fromPHP (new MyDocument )- ... えば以下のようになります。 { "_id" : { "$oid" : "56cccdcada14d8755a58c591" }, "foo" : "bar" } 例2 MongoDB\BSON\Serializable::bsonSerialize() returning a sequential array for root document <?php class MyArray implements MongoDB\BSON\Serializable { function bsonS ...
-
https://man.mtool.work/php/8.3/mongodb-bson-serializable.bsonserialize.html
- Serialization and deserialization of PHP variables into MongoDB | PHP 8.3 9877
- Serialization and deserialization of PHP variables into MongoDB This document discusses how compound structures (i.e. documents, arrays, and objects) are converted between BSON and PHP values. Serialization to BSON Arrays If an array is a p
... rties. If an object is of a class that implements the MongoDB\BSON\Serializable interface, call MongoDB\BSON\Serializable::bsonSerialize() and use the returned array or stdClass to serialize as a BSON document or array. The BSON type will be determined by the ... as a BSON document. MongoDB\BSON\Persistable objects must be serialized as a BSON document. If MongoDB\BSON\Serializable::bsonSerialize() returns a packed array, serialize as a BSON array. If MongoDB\BSON\Serializable::bsonSerialize() returns a non-packed ar ... ray or stdClass , serialize as a BSON document. If MongoDB\BSON\Serializable::bsonSerialize() did not return an array or stdClass , throw an MongoDB\Driver\Exception\UnexpectedValueException exception. If an object ...
-
https://man.mtool.work/php/8.3/mongodb.persistence.html
- MongoDB\Driver\ServerApi::bsonSerialize — Returns an object for BSON serializat... 9669
- MongoDB\Driver\ServerApi::bsonSerialize (mongodb >=1.10.0) MongoDB\Driver\ServerApi::bsonSerialize — Returns an object for BSON serialization 説明 final public function MongoDB\Driver\ServerApi::bsonSerialize (): stdClass パラメータ この関数
... 例外 Throws MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors. 参考 MongoDB\BSON\Serializable::bsonSerialize() - Provides an array or document to serialize as BSON ...
-
https://man.mtool.work/php/8.3/mongodb-driver-serverapi.bsonserialize.html
- The MongoDB\BSON\Persistable interface | PHP 8.3 9548
- The MongoDB\BSON\Persistable interface (mongodb >=1.0.0) はじめに Classes may implement this interface to take advantage of automatic ODM (object document mapping) behavior in the extension. During serialization, the extension 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 m ... e::bsonUnserialize() is invoked. See Persisting Data for additional information. 注意 : 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 doc ... N\Persistable implements MongoDB\BSON\Unserializable , MongoDB\BSON\Serializable { /* メソッド */ abstract public function bsonSerialize (): array | stdClass | MongoDB\BSON\Document /* 継承したメソッド */ abstract public function MongoDB\BSON\Serializable::bs ...
-
https://man.mtool.work/php/8.3/class.mongodb-bson-persistable.html
- MongoDB\BSON\Persistable::bsonSerialize — Provides an array or document to seri... 8646
- MongoDB\BSON\Persistable::bsonSerialize (mongodb >=1.0.0) MongoDB\BSON\Persistable::bsonSerialize — Provides an array or document to serialize as BSON 説明 abstract public function MongoDB\BSON\Persistable::bsonSerialize (): array | stdClas
... od may now also return MongoDB\BSON\Document instances in addition to array and stdClass . 参考 MongoDB\BSON\Serializable::bsonSerialize() - Provides an array or document to serialize as BSON MongoDB\BSON\Unserializable::bsonUnserialize() - Constructs the obj ...
-
https://man.mtool.work/php/8.3/mongodb-bson-persistable.bsonserialize.html
- The MongoDB\BSON\Serializable interface | PHP 8.3 7676
- The MongoDB\BSON\Serializable interface (mongodb >=1.0.0) はじめに Classes that implement this interface may return data to be serialized as a BSON array or document in lieu of the object's public properties. インターフェイス概要 class Mong
... oDB\BSON\Serializable implements MongoDB\BSON\Type { /* メソッド */ abstract public function bsonSerialize (): array | stdClass | MongoDB\BSON\Document | MongoDB\BSON\PackedArray } 変更履歴 バージョン 説明 PECL mongodb 2.0.0 Retu ... pes. The #[ReturnTypeWillChange] attribute can be added to silence the deprecation notice. 目次 MongoDB\BSON\Serializable::bsonSerialize — Provides an array or document to serialize as BSON ...
-
https://man.mtool.work/php/8.3/class.mongodb-bson-serializable.html
- The MongoDB\Driver\WriteConcern class | PHP 8.3 7243
- The MongoDB\Driver\WriteConcern class (mongodb >=1.0.0) はじめに MongoDB\Driver\WriteConcern describes the level of acknowledgement requested from MongoDB for write operations to a standalone mongod or to replica sets or to sharded clusters
... ring | int | null $ w ; public readonly ? bool $ j ; public readonly int $ wtimeout ; /* メソッド */ final public function bsonSerialize (): stdClass final public function __construct ( string | int $w , ? int $wtimeout = null , ? bool $journal = null ) final ... .7.0 Implements Serializable . PECL mongodb 1.2.0 Implements MongoDB\BSON\Serializable . 目次 MongoDB\Driver\WriteConcern::bsonSerialize — Returns an object for BSON serialization MongoDB\Driver\WriteConcern::__construct — Create a new WriteConcern MongoDB\Dr ...
-
https://man.mtool.work/php/8.3/class.mongodb-driver-writeconcern.html