Results of 1 - 6 of about 6 for MyDocument (0.001 sec.)
- Constructs the object from a BSON array or document 11333
- « MongoDB\BSON\Unserializable MongoDB\BSON\BinaryInterface » PHP Manual MongoDB\BSON\Unserializable Constructs the object from a BSON array or document 検索 MongoDB\BSON\Unserializable::bsonUnserialize (mongodb >=1.0.0) MongoDB\BSON\Unseria
... eviously declared as tentative are now enforced. 例 例1 MongoDB\BSON\Unserializable::bsonUnserialize() example <?php class MyDocument implements MongoDB\BSON\Unserializable { private $data = []; function bsonUnserialize (array $data ): void { $this -> data ... = $data ; } } $bson = MongoDB\BSON\Document :: fromJSON ( '{ "foo": "bar" }' ); var_dump ( $bson -> toPHP ([ 'root' => 'MyDocument' ])); ?> 上の例の出力は以下となります。 object(MyDocument)#1 (1) { ["data":"MyDocument":private]=> array(1) { ["foo"]=> st ... \BSON\Persistable Persisting Data 関連キーワード: array MongoDB data document Unserializable object bsonUnserialize method MyDocument Constructs mongodb function void private bson foo bar Search BinaryInterface abstract ...
-
https://man.mtool.work/php/8.3/mongodb-bson-unserializable.bsonunserialize.html
- Constructs the object from a BSON array or document 11333
- « MongoDB\BSON\Unserializable MongoDB\BSON\BinaryInterface » PHP Manual MongoDB\BSON\Unserializable Constructs the object from a BSON array or document 検索 MongoDB\BSON\Unserializable::bsonUnserialize (mongodb >=1.0.0) MongoDB\BSON\Unseria
... eviously declared as tentative are now enforced. 例 例1 MongoDB\BSON\Unserializable::bsonUnserialize() example <?php class MyDocument implements MongoDB\BSON\Unserializable { private $data = []; function bsonUnserialize (array $data ): void { $this -> data ... = $data ; } } $bson = MongoDB\BSON\Document :: fromJSON ( '{ "foo": "bar" }' ); var_dump ( $bson -> toPHP ([ 'root' => 'MyDocument' ])); ?> 上の例の出力は以下となります。 object(MyDocument)#1 (1) { ["data":"MyDocument":private]=> array(1) { ["foo"]=> st ... ze as BSON MongoDB\BSON\Persistable Persisting Data 関連キーワード: MongoDB document Unserializable bsonUnserialize method MyDocument Constructs mongodb private bson BinaryInterface abstract Called during unserialization properties passed Remember check pr ...
-
https://man.mtool.work/php/8.3/mongodb-bson-unserializable.bsonunserialize.html
- Provides an array or document to serialize as BSON 9578
- « MongoDB\BSON\Serializable MongoDB\BSON\Unserializable » PHP Manual MongoDB\BSON\Serializable Provides an array or document to serialize as BSON 検索 MongoDB\BSON\Serializable::bsonSerialize (mongodb >=1.0.0) MongoDB\BSON\Serializable::bso
... ield 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 ; } ... bsonSerialize (): array { return [ '_id' => $this -> id , 'foo' => 'bar' ]; } } echo MongoDB\BSON\Document :: fromPHP (new MyDocument )-> toRelaxedExtendedJSON (), "\n" ; ?> 上の例の出力は、 たとえば以下のようになります。 { "_id" : { "$oid" : "56cccdcada14 ... 2, "2" : 3 } 例3 MongoDB\BSON\Serializable::bsonSerialize() returning an associative array for document field <?php class MyDocument implements MongoDB\BSON\Serializable { function bsonSerialize (): array { return [ 'foo' => 'bar' ]; } } $value = [ 'docum ...
-
https://man.mtool.work/php/8.3/mongodb-bson-serializable.bsonserialize.html
- Provides an array or document to serialize as BSON 8755
- « MongoDB\BSON\Serializable MongoDB\BSON\Unserializable » PHP Manual MongoDB\BSON\Serializable Provides an array or document to serialize as BSON 検索 MongoDB\BSON\Serializable::bsonSerialize (mongodb >=1.0.0) MongoDB\BSON\Serializable::bso
... ield 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 ; } ... bsonSerialize (): array { return [ '_id' => $this -> id , 'foo' => 'bar' ]; } } echo MongoDB\BSON\Document :: fromPHP (new MyDocument )-> toRelaxedExtendedJSON (), "\n" ; ?> 上の例の出力は、 たとえば以下のようになります。 { "_id" : { "$oid" : "56cccdcada14 ... 2, "2" : 3 } 例3 MongoDB\BSON\Serializable::bsonSerialize() returning an associative array for document field <?php class MyDocument implements MongoDB\BSON\Serializable { function bsonSerialize (): array { return [ 'foo' => 'bar' ]; } } $value = [ 'docum ...
-
https://man.mtool.work/php/8.3/mongodb-bson-serializable.bsonserialize.html
- 基底ノード型を作成する際に使用する拡張クラスを登録する 6891
- « DOMDocument::prepend DOMDocument::relaxNGValidate » PHP Manual DOMDocument 基底ノード型を作成する際に使用する拡張クラスを登録する 検索 DOMDocument::registerNodeClass (PHP 5 >= 5.2.0, PHP 7, PHP 8) DOMDocument::registerNodeClass — 基底ノー
... t extends DOMElement { function appendElement ( $name ) { return $this -> appendChild (new myElement ( $name )); } } class myDocument extends DOMDocument { function setRoot ( $name ) { return $this -> appendChild (new myElement ( $name )); } } $doc = new m ...
-
https://man.mtool.work/php/8.3/domdocument.registernodeclass.html
- 基底ノード型を作成する際に使用する拡張クラスを登録する 6891
- « DOMDocument::prepend DOMDocument::relaxNGValidate » PHP Manual DOMDocument 基底ノード型を作成する際に使用する拡張クラスを登録する 検索 DOMDocument::registerNodeClass (PHP 5 >= 5.2.0, PHP 7, PHP 8) DOMDocument::registerNodeClass — 基底ノー
... t extends DOMElement { function appendElement ( $name ) { return $this -> appendChild (new myElement ( $name )); } } class myDocument extends DOMDocument { function setRoot ( $name ) { return $this -> appendChild (new myElement ( $name )); } } $doc = new m ...
-
https://man.mtool.work/php/8.3/domdocument.registernodeclass.html
PREV
1
NEXT