fixed ModelType for symfony 3 (#410)

This commit is contained in:
Gregor Harlan 2016-04-14 12:10:14 +02:00 committed by Marc J. Schmidt
parent 07b5a60f1b
commit 5fd4b68de2

View file

@ -10,6 +10,7 @@
namespace Propel\Bundle\PropelBundle\Form\ChoiceList;
use Propel\Runtime\ActiveQuery\Criteria;
use Propel\Runtime\ActiveQuery\ModelCriteria;
use Propel\Runtime\ActiveRecord\ActiveRecordInterface;
use Propel\Runtime\Map\ColumnMap;
@ -110,7 +111,8 @@ class PropelChoiceLoader implements ChoiceLoaderInterface
// Optimize performance in case we have a single-field identifier
if (!$this->choiceList && $this->identifierAsIndex && current($this->identifier) instanceof ColumnMap) {
$phpName = current($this->identifier)->getPhpName();
$unorderedObjects = $this->query->filterBy($phpName, $values);
$query = clone $this->query;
$unorderedObjects = $query->filterBy($phpName, $values, Criteria::IN);
$objectsById = array();
$objects = array();