lib/Doctrine/DBAL/Connection.php
public function convertToDatabaseValue($value, $type)
    {
        return Type::getType($type)->convertToDatabaseValue($value, $this->getDatabasePlatform());
    }
public function convertToDatabaseValue($value, $type)
    {
        return Type::getType($type)->convertToDatabaseValue($value, $this->getDatabasePlatform());
    }
public function convertToDatabaseValue ( $ value , $ type ) { return Type :: getType ( $ type ) -> convertToDatabaseValue ( $ value , $ this -> getDatabasePlatform ( ) ) ; }
Converts a given value to its database representation according to the conversion
rules of a specific DBAL mapping type.

@param mixed  $value The value to convert.
@param string $type  The name of the DBAL mapping type.

@return mixed The converted value.
Converts a given value to its database representation according to the conversion rules of a specific DBAL mapping type .