public function convertToDatabaseValue($value, $connection, $prepared = false)
    {
        if (false === $prepared) {
            $value = $this->prepareValue($value);
        }

        return Type::getType($this->dbType($connection))
            ->convertToDatabaseValue(
                $value,
                $connection->getDatabasePlatform()
            );
    }
public function convertToDatabaseValue($value, $connection, $prepared = false)
    {
        if (false === $prepared) {
            $value = $this->prepareValue($value);
        }

        return Type::getType($this->dbType($connection))
            ->convertToDatabaseValue(
                $value,
                $connection->getDatabasePlatform()
            );
    }
public function convertToDatabaseValue ( $ value , $ connection , $ prepared = false ) { if ( false === $ prepared ) { $ value = $ this -> prepareValue ( $ value ) ; } return Type :: getType ( $ this -> dbType ( $ connection ) ) -> convertToDatabaseValue ( $ value , $ connection -> getDatabasePlatform ( ) ) ; }
Converts value to a backend-specific value. this will be used also
when creating lookups.

By default it returns value passed in if prepared=true and
prepareValue() if is False.

@param mixed               $value
@param ConnectionInterface $connection

@return mixed

@since  1.1.0

@author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>

@throws \Doctrine\DBAL\DBALException
Converts value to a backend - specific value . this will be used also when creating lookups .