The MongoDB\BSON\PackedArray class

Introduction

Represents a BSON array. This class is used when reading data as raw BSON and cannot be modified.

Class synopsis

MongoDB\BSON\PackedArray
final class MongoDB\BSON\PackedArray implements MongoDB\BSON\Type, ArrayAccess, IteratorAggregate, Serializable {
/* Methods */
final private __construct()
final static public MongoDB\BSON\PackedArray fromJSON(string $json)
final static public MongoDB\BSON\PackedArray fromPHP(array $value)
final public mixed get(int $key)
final public MongoDB\BSON\Iterator getIterator()
final public bool has(int $index)
final public bool offsetExists(mixed $key)
final public mixed offsetGet(mixed $key)
final public void offsetSet(mixed $key, mixed $value)
final public void offsetUnset(mixed $key)
final public string serialize()
final public string toCanonicalExtendedJSON()
final public arrayobject toPHP(arraynull $typeMap = null)
final public string toRelaxedExtendedJSON()
final public string __toString()
final public void unserialize(string $data)
}

Changelog

Version Description
PECL mongodb 1.17.0 Implements MongoDB\BSON\Type.
PECL mongodb 1.17.0 MongoDB\BSON\PackedArray cannot be serialized in contexts where a BSON document is expected. In earlier versions, the BSON array would have been converted to a document.

Table of Contents