PHP Class Doctrine\ODM\MongoDB\Mapping\Types\Type

Since: 1.0
Author: Jonathan H. Wage ([email protected])
Author: Roman Borschel ([email protected])
Show file Open project: pmjones/php-framework-benchmarks Class Usage Examples

Public Methods

Method Description
addType ( string $name, string $className ) Adds a custom type to the type map.
convertToDatabaseValue ( mixed $value ) : mixed Converts a value from its PHP representation to its database representation of this type.
convertToPHPValue ( mixed $value ) : mixed Converts a value from its database representation to its PHP representation of this type.
getType ( string $type ) : Doctrine\ODM\MongoDB\Mapping\Types\Type Get a Type instance.
getTypesMap ( ) : array Get the types array map which holds all registered types and the corresponding type class
hasType ( string $name ) : boolean Checks if exists support for a type.
overrideType ( string $name, string $className ) Overrides an already defined type to use a different implementation.
registerType ( string $name, string $class ) Register a new type in the type map.

Method Details

addType() public static method

Adds a custom type to the type map.
public static addType ( string $name, string $className )
$name string Name of the type. This should correspond to what getName() returns.
$className string The class name of the custom type.

convertToDatabaseValue() public method

Converts a value from its PHP representation to its database representation of this type.
public convertToDatabaseValue ( mixed $value ) : mixed
$value mixed The value to convert.
return mixed The database representation of the value.

convertToPHPValue() public method

Converts a value from its database representation to its PHP representation of this type.
public convertToPHPValue ( mixed $value ) : mixed
$value mixed The value to convert.
return mixed The PHP representation of the value.

getType() public static method

Get a Type instance.
public static getType ( string $type ) : Doctrine\ODM\MongoDB\Mapping\Types\Type
$type string The type name.
return Doctrine\ODM\MongoDB\Mapping\Types\Type $type

getTypesMap() public static method

Get the types array map which holds all registered types and the corresponding type class
public static getTypesMap ( ) : array
return array $typesMap

hasType() public static method

Checks if exists support for a type.
public static hasType ( string $name ) : boolean
$name string Name of the type
return boolean TRUE if type is supported; FALSE otherwise

overrideType() public static method

Overrides an already defined type to use a different implementation.
public static overrideType ( string $name, string $className )
$name string
$className string

registerType() public static method

Register a new type in the type map.
public static registerType ( string $name, string $class )
$name string The name of the type.
$class string The class name.