for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sonata\DoctrineORMAdminBundle\Tests\Fixtures\DoctrineType;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\StringType;
use Sonata\DoctrineORMAdminBundle\Tests\Model\Uuid;
class UuidType extends StringType
{
const NAME = 'uuid';
public function getName()
return self::NAME;
}
/**
* {@inheritDoc}
*/
public function convertToPHPValue($value, AbstractPlatform $platform)
return !empty($value) ? new Uuid($value) : null;
public function convertToDatabaseValue($value, AbstractPlatform $platform)
return $value->toString();