[PropertyInfo][DoctrineBridge] The bigint Doctrine's type must be converted to string

This commit is contained in:
Kévin Dunglas 2017-05-31 12:58:03 +02:00
parent af6b25b28c
commit 47d5e6b82c
No known key found for this signature in database
GPG Key ID: 4D04EBEF06AAF3A6
3 changed files with 9 additions and 4 deletions

View File

@ -174,13 +174,13 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE
{
switch ($doctrineType) {
case DBALType::SMALLINT:
case DBALType::BIGINT:
case DBALType::INTEGER:
return Type::BUILTIN_TYPE_INT;
case DBALType::FLOAT:
return Type::BUILTIN_TYPE_FLOAT;
case DBALType::BIGINT:
case DBALType::STRING:
case DBALType::TEXT:
case DBALType::GUID:
@ -196,9 +196,6 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE
case DBALType::OBJECT:
return Type::BUILTIN_TYPE_OBJECT;
default:
return;
}
}
}

View File

@ -55,6 +55,7 @@ class DoctrineExtractorTest extends TestCase
'bool',
'binary',
'customFoo',
'bigint',
'foo',
'bar',
'indexedBar',
@ -76,6 +77,7 @@ class DoctrineExtractorTest extends TestCase
return array(
array('id', array(new Type(Type::BUILTIN_TYPE_INT))),
array('guid', array(new Type(Type::BUILTIN_TYPE_STRING))),
array('bigint', array(new Type(Type::BUILTIN_TYPE_STRING))),
array('float', array(new Type(Type::BUILTIN_TYPE_FLOAT))),
array('decimal', array(new Type(Type::BUILTIN_TYPE_STRING))),
array('bool', array(new Type(Type::BUILTIN_TYPE_BOOL))),

View File

@ -11,6 +11,7 @@
namespace Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\Id;
@ -90,5 +91,10 @@ class DoctrineDummy
*/
private $customFoo;
/**
* @Column(type="bigint")
*/
private $bigint;
public $notMapped;
}