class BinDataByteArrayType extends BinDataType (View source)

The BinData type for byte array data.

Per the BSON specification, this sub-type is deprecated in favor of the generic sub-type (BinDataType class).

Constants

ID

INTID

CUSTOMID

BOOL

BOOLEAN

INT

INTEGER

FLOAT

STRING

DATE

KEY

TIMESTAMP

BINDATA

BINDATAFUNC

BINDATABYTEARRAY

BINDATAUUID

BINDATAUUIDRFC4122

BINDATAMD5

BINDATACUSTOM

HASH

COLLECTION

OBJECTID

RAW

Properties

protected int $binDataType

Methods

mixed
convertToDatabaseValue(mixed $value)

Converts a value from its PHP representation to its database representation of this type.

mixed
convertToPHPValue(mixed $value)

Converts a value from its database representation to its PHP representation of this type.

closureToMongo()

No description

closureToPHP()

No description

static 
registerType(string $name, string $class)

Register a new type in the type map.

from Type
static Type
getType(string $type)

Get a Type instance.

from Type
static Type
getTypeFromPHPVariable(mixed $variable)

Get a Type instance based on the type of the passed php variable.

from Type
static 
convertPHPToDatabaseValue($value)

No description

from Type
static 
addType(string $name, string $className)

Adds a custom type to the type map.

from Type
static bool
hasType(string $name)

Checks if exists support for a type.

from Type
static 
overrideType(string $name, string $className)

Overrides an already defined type to use a different implementation.

from Type
static array
getTypesMap()

Get the types array map which holds all registered types and the corresponding type class

from Type
__toString()

No description

from Type

Details

mixed convertToDatabaseValue(mixed $value)

Converts a value from its PHP representation to its database representation of this type.

Parameters

mixed $value The value to convert.

Return Value

mixed The database representation of the value.

mixed convertToPHPValue(mixed $value)

Converts a value from its database representation to its PHP representation of this type.

Parameters

mixed $value The value to convert.

Return Value

mixed The PHP representation of the value.

closureToMongo()

closureToPHP()

static registerType(string $name, string $class)

Register a new type in the type map.

Parameters

string $name The name of the type.
string $class The class name.

static Type getType(string $type)

Get a Type instance.

Parameters

string $type The type name.

Return Value

Type $type

Exceptions

InvalidArgumentException

static Type getTypeFromPHPVariable(mixed $variable)

Get a Type instance based on the type of the passed php variable.

Parameters

mixed $variable

Return Value

Type $type

Exceptions

InvalidArgumentException

static convertPHPToDatabaseValue($value)

Parameters

$value

static addType(string $name, string $className)

Adds a custom type to the type map.

Parameters

string $name Name of the type. This should correspond to what getName() returns.
string $className The class name of the custom type.

Exceptions

MappingException

static bool hasType(string $name)

Checks if exists support for a type.

Parameters

string $name Name of the type

Return Value

bool TRUE if type is supported; FALSE otherwise

static overrideType(string $name, string $className)

Overrides an already defined type to use a different implementation.

Parameters

string $name
string $className

Exceptions

MappingException

static array getTypesMap()

Get the types array map which holds all registered types and the corresponding type class

Return Value

array $typesMap

__toString()