BSON type classes and serialization functions目次
The MongoDB\BSON\Document classはじめにRepresents a BSON document. This class is used when reading data as raw BSON and cannot be modified. クラス概要MongoDB\BSON\Document
final
class MongoDB\BSON\Document
implements
MongoDB\BSON\Type, IteratorAggregate, Serializable {
/* メソッド */
final private __construct()
final static public MongoDB\BSON\Document fromBSON(string
$bson )final static public MongoDB\BSON\Document fromJSON(string
$json )final static public MongoDB\BSON\Document fromPHP(objectarray
$value )final public mixed get(string
$key )final public MongoDB\BSON\Iterator getIterator()
final public bool has(string
$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 )変更履歴
The MongoDB\BSON\PackedArray classはじめにRepresents a BSON array. This class is used when reading data as raw BSON and cannot be modified. クラス概要MongoDB\BSON\PackedArray
final
class MongoDB\BSON\PackedArray
implements
MongoDB\BSON\Type, IteratorAggregate, Serializable {
/* メソッド */
final private __construct()
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 string serialize()
final public arrayobject toPHP(arraynull
$typeMap = null )final public string __toString()
final public void unserialize(string
}$data )変更履歴
The MongoDB\BSON\Iterator classはじめにIterator used to iterate a BSON document or array. クラス概要MongoDB\BSON\Iterator
final
class MongoDB\BSON\Iterator
implements
Iterator {
/* メソッド */
final private __construct()
public mixed current()
public stringint key()
public void next()
public void rewind()
public bool valid()
}The MongoDB\BSON\Binary classはじめにBSON type for binary data (i.e. array of bytes). Binary values also have a subtype, which is used to indicate what kind of data is in the byte array. Subtypes from zero to 127 are predefined or reserved. Subtypes from 128-255 are user-defined. クラス概要MongoDB\BSON\Binary
final
class MongoDB\BSON\Binary
implements
MongoDB\BSON\BinaryInterface, MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* 定数 */
const
int
MongoDB\BSON\Binary::TYPE_GENERIC = 0;
const
int
MongoDB\BSON\Binary::TYPE_FUNCTION = 1;
const
int
MongoDB\BSON\Binary::TYPE_OLD_BINARY = 2;
const
int
MongoDB\BSON\Binary::TYPE_OLD_UUID = 3;
const
int
MongoDB\BSON\Binary::TYPE_UUID = 4;
const
int
MongoDB\BSON\Binary::TYPE_MD5 = 5;
const
int
MongoDB\BSON\Binary::TYPE_ENCRYPTED = 6;
const
int
MongoDB\BSON\Binary::TYPE_COLUMN = 7;
const
int
MongoDB\BSON\Binary::TYPE_SENSITIVE = 8;
const
int
MongoDB\BSON\Binary::TYPE_USER_DEFINED = 128;
/* メソッド */
final public __construct(string
$data , int $type = MongoDB\BSON\Binary::TYPE_GENERIC)final public string getData()
final public int getType()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string
}$data )定義済み定数
変更履歴
The MongoDB\BSON\Decimal128 classはじめにBSON type for the » Decimal128 floating-point format, which supports numbers with up to 34 decimal digits (i.e. significant digits) and an exponent range of −6143 to +6144.
Unlike the double BSON type (i.e. float in PHP), which only
stores an approximation of the decimal values, the decimal data type stores
the exact value. For example,
クラス概要MongoDB\BSON\Decimal128
final
class MongoDB\BSON\Decimal128
implements
MongoDB\BSON\Decimal128Interface, MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final public __construct(string
$value )final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string
}$data )変更履歴
The MongoDB\BSON\Javascript classはじめにBSON type for Javascript code. An optional scope document may be specified that maps identifiers to values and defines the scope in which the code should be evaluated by the server.
クラス概要MongoDB\BSON\Javascript
final
class MongoDB\BSON\Javascript
implements
MongoDB\BSON\JavascriptInterface, MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final public __construct(string
$code , arrayobjectnull $scope = null )final public string getCode()
final public objectnull getScope()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string
}$data )変更履歴
The MongoDB\BSON\MaxKey classはじめにSpecial BSON type which compares higher than all other possible BSON element values.
クラス概要MongoDB\BSON\MaxKey
final
class MongoDB\BSON\MaxKey
implements
MongoDB\BSON\MaxKeyInterface, MongoDB\BSON\Type, Serializable, JsonSerializable {
/* メソッド */
final public __construct()
final public mixed jsonSerialize()
final public string serialize()
final public void unserialize(string
}$data )変更履歴
The MongoDB\BSON\MinKey classはじめにSpecial BSON type which compares lower than all other possible BSON element values.
クラス概要MongoDB\BSON\MinKey
final
class MongoDB\BSON\MinKey
implements
MongoDB\BSON\MinKeyInterface, MongoDB\BSON\Type, Serializable, JsonSerializable {
/* メソッド */
final public __construct()
final public mixed jsonSerialize()
final public string serialize()
final public void unserialize(string
}$data )変更履歴
The MongoDB\BSON\ObjectId classはじめにBSON type for an » ObjectId. The value consists of 12 bytes, where the first four bytes are a timestamp that reflect the ObjectId's creation. Specifically, the value consists of:
In MongoDB, each document stored in a collection requires a unique
Using ObjectIds for the
クラス概要MongoDB\BSON\ObjectId
final
class MongoDB\BSON\ObjectId
implements
MongoDB\BSON\ObjectIdInterface, MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final public __construct(stringnull
$id = null )final public int getTimestamp()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string
}$data )変更履歴
The MongoDB\BSON\Regex classはじめにBSON type for a regular expression pattern and optional » flags.
クラス概要MongoDB\BSON\Regex
final
class MongoDB\BSON\Regex
implements
MongoDB\BSON\RegexInterface, MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final public __construct(string
$pattern , string $flags = "")final public string getFlags()
final public string getPattern()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string
}$data )変更履歴
The MongoDB\BSON\Timestamp classはじめにRepresents a » BSON timestamp, The value consists of a 4-byte timestamp (i.e. seconds since the epoch) and a 4-byte increment.
クラス概要MongoDB\BSON\Timestamp
final
class MongoDB\BSON\Timestamp
implements
MongoDB\BSON\TimestampInterface, MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final public __construct(int
$increment , int $timestamp )final public int getIncrement()
final public int getTimestamp()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string
}$data )変更履歴
The MongoDB\BSON\UTCDateTime classはじめにRepresents a » BSON date. The value is a 64-bit integer that represents the number of milliseconds since the Unix epoch (Jan 1, 1970). Negative values represent dates before 1970. クラス概要MongoDB\BSON\UTCDateTime
final
class MongoDB\BSON\UTCDateTime
implements
MongoDB\BSON\UTCDateTimeInterface, MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final public __construct(intfloatstringDateTimeInterfacenull
$milliseconds = null )final public mixed jsonSerialize()
final public string serialize()
final public DateTime toDateTime()
final public string __toString()
final public void unserialize(string
}$data )変更履歴
The MongoDB\BSON\Type interfaceはじめにAbstract base interface that should not be implemented directly. インターフェイス概要MongoDB\BSON\Type
class MongoDB\BSON\Type
{
}This interface has no methods. Its only purpose is to be the base interface for all BSON type classes. The MongoDB\BSON\Persistable interfaceはじめにClasses may implement this interface to take advantage of automatic ODM (object document mapping) behavior in the driver. During serialization, the driver 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 map configuration) to be constructed before MongoDB\BSON\Unserializable::bsonUnserialize is invoked. See Persisting Data for additional information.
インターフェイス概要MongoDB\BSON\Persistable
class MongoDB\BSON\Persistable
implements
MongoDB\BSON\Unserializable, MongoDB\BSON\Serializable {
/* メソッド */
abstract public arraystdClassMongoDB\BSON\Document bsonSerialize()
/* 継承したメソッド */
abstract public arraystdClassMongoDB\BSON\DocumentMongoDB\BSON\PackedArray MongoDB\BSON\Serializable::bsonSerialize()
abstract public void MongoDB\BSON\Unserializable::bsonUnserialize(array
}$data )The MongoDB\BSON\Serializable interfaceはじめに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. インターフェイス概要MongoDB\BSON\Serializable
class MongoDB\BSON\Serializable
implements
MongoDB\BSON\Type {
/* メソッド */
abstract public arraystdClassMongoDB\BSON\DocumentMongoDB\BSON\PackedArray bsonSerialize()
}変更履歴
The MongoDB\BSON\Unserializable interfaceはじめにClasses that implement this interface may be specified in a type map for unserializing BSON arrays and documents (both root and embedded). インターフェイス概要MongoDB\BSON\Unserializable
class MongoDB\BSON\Unserializable
{
/* メソッド */
abstract public void bsonUnserialize(array
}$data )変更履歴
The MongoDB\BSON\BinaryInterface interfaceはじめにThis interface is implemented by MongoDB\BSON\Binary to be used as a parameter, return, or property type in userland classes. クラス概要MongoDB\BSON\BinaryInterface
class MongoDB\BSON\BinaryInterface
{
/* メソッド */
abstract public string getData()
abstract public int getType()
abstract public string __toString()
}変更履歴
The MongoDB\BSON\Decimal128Interface interfaceはじめにThis interface is implemented by MongoDB\BSON\Decimal128 to be used as a parameter, return, or property type in userland classes. クラス概要MongoDB\BSON\Decimal128Interface
class MongoDB\BSON\Decimal128Interface
{
/* メソッド */
abstract public string __toString()
}変更履歴
The MongoDB\BSON\JavascriptInterface interfaceはじめにThis interface is implemented by MongoDB\BSON\Javascript to be used as a parameter, return, or property type in userland classes. クラス概要MongoDB\BSON\JavascriptInterface
class MongoDB\BSON\JavascriptInterface
{
/* メソッド */
abstract public string getCode()
abstract public objectnull getScope()
abstract public string __toString()
}変更履歴
The MongoDB\BSON\MaxKeyInterface interfaceはじめにThis interface is implemented by MongoDB\BSON\MaxKey to be used as a parameter, return, or property type in userland classes. クラス概要MongoDB\BSON\MaxKeyInterface
class MongoDB\BSON\MaxKeyInterface
{
}This interface has no methods. The MongoDB\BSON\MinKeyInterface interfaceはじめにThis interface is implemented by MongoDB\BSON\MinKey to be used as a parameter, return, or property type in userland classes. クラス概要MongoDB\BSON\MinKeyInterface
class MongoDB\BSON\MinKeyInterface
{
}This interface has no methods. The MongoDB\BSON\ObjectIdInterface interfaceはじめにThis interface is implemented by MongoDB\BSON\ObjectId to be used as a parameter, return, or property type in userland classes. クラス概要MongoDB\BSON\ObjectIdInterface
class MongoDB\BSON\ObjectIdInterface
{
/* メソッド */
abstract public int getTimestamp()
abstract public string __toString()
}変更履歴
The MongoDB\BSON\RegexInterface interfaceはじめにThis interface is implemented by MongoDB\BSON\Regex to be used as a parameter, return, or property type in userland classes. クラス概要MongoDB\BSON\RegexInterface
class MongoDB\BSON\RegexInterface
{
/* メソッド */
abstract public string getFlags()
abstract public string getPattern()
abstract public string __toString()
}変更履歴
The MongoDB\BSON\TimestampInterface interfaceはじめにThis interface is implemented by MongoDB\BSON\Timestamp to be used as a parameter, return, or property type in userland classes. クラス概要MongoDB\BSON\TimestampInterface
class MongoDB\BSON\TimestampInterface
{
/* メソッド */
abstract public int getIncrement()
abstract public int getTimestamp()
abstract public string __toString()
}変更履歴
The MongoDB\BSON\UTCDateTimeInterface interfaceはじめにThis interface is implemented by MongoDB\BSON\UTCDateTime to be used as a parameter, return, or property type in userland classes. クラス概要MongoDB\BSON\UTCDateTimeInterface
class MongoDB\BSON\UTCDateTimeInterface
{
/* メソッド */
abstract public DateTime toDateTime()
abstract public string __toString()
}変更履歴
The MongoDB\BSON\DBPointer class (deprecated)はじめにBSON type for the "DBPointer" type. This BSON type is deprecated, and this class can not be instantiated. It will be created from a BSON DBPointer type while converting BSON to PHP, and can also be converted back into BSON while storing documents in the database. クラス概要MongoDB\BSON\DBPointer
final
class MongoDB\BSON\DBPointer
implements
MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final private __construct()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string
}$data )変更履歴
The MongoDB\BSON\Int64 classはじめにBSON type for a 64-bit integer. When decoding BSON to PHP data, this class is used when a 64-bit integer cannot be represented as a PHP integer on 32-bit platforms. These objects support overloaded arithmetic, bitwise, and comparison operators. When working with raw BSON data through the MongoDB\BSON\Document, MongoDB\BSON\PackedArray, and MongoDB\BSON\Iterator classes, any 64-bit integer will be returned as an instance of this class, regardless of platform and whether the value can be represented as a PHP integer. This ensures that values can be roundtripped without changing the type. During BSON encoding, objects of this class will convert back to a 64-bit integer type, even when the value would fit in a 32-bit integer. This allows explicitly storing values as 64-bit integers in BSON. クラス概要MongoDB\BSON\Int64
final
class MongoDB\BSON\Int64
implements
MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final public __construct(intstring
$value )final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string
}$data )変更履歴
The MongoDB\BSON\Symbol class (deprecated)はじめにBSON type for the "Symbol" type. This BSON type is deprecated, and this class can not be instantiated. It will be created from a BSON symbol type while converting BSON to PHP, and can also be converted back into BSON while storing documents in the database. クラス概要MongoDB\BSON\Symbol
final
class MongoDB\BSON\Symbol
implements
MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final private __construct()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string
}$data )変更履歴
The MongoDB\BSON\Undefined class (deprecated)はじめにBSON type for the "Undefined" type. This BSON type is deprecated, and this class can not be instantiated. It will be created from a BSON undefined type while converting BSON to PHP, and can also be converted back into BSON while storing documents in the database. クラス概要MongoDB\BSON\Undefined
final
class MongoDB\BSON\Undefined
implements
MongoDB\BSON\Type, Serializable, JsonSerializable, Stringable {
/* メソッド */
final private __construct()
final public mixed jsonSerialize()
final public string serialize()
final public string __toString()
final public void unserialize(string
}$data )変更履歴
|