for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ZFBrasil\DoctrineMoneyModule\DBAL\Types;
use Doctrine\DBAL\Types\StringType;
use Money\Currency;
use Doctrine\DBAL\Platforms\AbstractPlatform;
/**
* @author Fábio Carneiro <[email protected]>
* @license MIT
*/
class CurrencyType extends StringType
{
const NAME = 'currency';
* {@inheritdoc}
public function getName()
return self::NAME;
}
public function convertToPHPValue($value, AbstractPlatform $platform)
if ($value === null || $value instanceof Currency) {
return $value;
return new Currency($value);