Model class for a BSON document.
The internal data will be cast to an object during BSON serialization to ensure that it becomes a BSON document.
- Full name:
\MongoDB\Model\BSONDocument
- Parent class:
ArrayObject
- This class implements:
\JsonSerializable
,\MongoDB\BSON\Serializable
,\MongoDB\BSON\Unserializable
Deep clone this BSONDocument.
public __clone(): mixed
This overrides the parent constructor to allow property access of entries by default.
public __construct(array $input = [], int $flags = ArrayObject::ARRAY_AS_PROPS, string $iteratorClass = 'ArrayIterator'): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$input |
array | |
$flags |
int | |
$iteratorClass |
string |
See Also:
Factory method for var_export().
public static __set_state(array $properties): self
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$properties |
array |
See Also:
Serialize the document to BSON.
public bsonSerialize(): object
See Also:
Unserialize the document to BSON.
public bsonUnserialize(array $data): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$data |
array | Array data |
See Also:
Serialize the array to JSON.
public jsonSerialize(): object
See Also: