Sonata\Component\Currency\CurrencyDoctrineType::convertToDatabaseValue PHP Method

convertToDatabaseValue() public method

public convertToDatabaseValue ( $value, Doctrine\DBAL\Platforms\AbstractPlatform $platform )
$platform Doctrine\DBAL\Platforms\AbstractPlatform
    public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        if (!$value instanceof CurrencyInterface) {
            throw new \RuntimeException(sprintf("'currency' type only handles values of type Sonata\\Component\\Currency\\CurrencyInterface ; value of type %s given", is_object($value) ? get_class($value) : gettype($value)));
        }
        return $value->getLabel();
    }