merged branch sterrien/patch-4 (PR #7519)

This PR was merged into the 2.1 branch.

Discussion
----------

[Form] [Doctrine] [EntityChoiceList] idAsIndex should be true with a smallint id field.

When the id of an entity is a smallint, $this->idAsIndex should also be true.
It was not the case.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: should
License of the code: MIT

Commits
-------

673fd9b  idAsIndex should be true with a smallint or bigint id field.
This commit is contained in:
Fabien Potencier 2013-04-01 10:01:59 +02:00
commit bf7daa11e7
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ class EntityChoiceList extends ObjectChoiceList
$this->idField = $identifier[0];
$this->idAsValue = true;
if ('integer' === $this->classMetadata->getTypeOfField($this->idField)) {
if (in_array($this->classMetadata->getTypeOfField($this->idField), array('integer', 'smallint', 'bigint'))) {
$this->idAsIndex = true;
}
}