class HashType extends Type (View source)

The Hash type.

Constants

ID

INTID

CUSTOMID

BOOL

BOOLEAN

INT

INTEGER

FLOAT

STRING

DATE

KEY

TIMESTAMP

BINDATA

BINDATAFUNC

BINDATABYTEARRAY

BINDATAUUID

BINDATAUUIDRFC4122

BINDATAMD5

BINDATACUSTOM

HASH

COLLECTION

OBJECTID

RAW

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

from Type
closureToPHP()

No description

from Type
static 
registerType(string $name, string $class)

Register a new type in the type map.

from Type
static 
getType(string $type)

Get a Type instance.

from Type
static 
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 
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 
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
string $class

static getType(string $type)

Get a Type instance.

Parameters

string $type

Exceptions

InvalidArgumentException

static getTypeFromPHPVariable(mixed $variable)

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

Parameters

mixed $variable

Exceptions

InvalidArgumentException

static convertPHPToDatabaseValue($value)

Parameters

$value

static addType(string $name, string $className)

Adds a custom type to the type map.

Parameters

string $name
string $className

Exceptions

MappingException

static hasType(string $name)

Checks if exists support for a type.

Parameters

string $name

static overrideType(string $name, string $className)

Overrides an already defined type to use a different implementation.

Parameters

string $name
string $className

Exceptions

MappingException

static getTypesMap()

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

__toString()