Merge pull request #431 from peter17/3.0

Fix error on Form/Type/ModelType.php.
This commit is contained in:
Toni Uebernickel 2016-10-13 18:16:54 +02:00 committed by GitHub
commit c605b9346f

View file

@ -178,7 +178,10 @@ class ModelType extends AbstractType
$firstIdentifier = current($identifier); $firstIdentifier = current($identifier);
if (count($identifier) === 1 && in_array($firstIdentifier->getPdoType(), [\PDO::PARAM_BOOL, \PDO::PARAM_INT, \PDO::PARAM_STR])) { if (count($identifier) === 1 && in_array($firstIdentifier->getPdoType(), [\PDO::PARAM_BOOL, \PDO::PARAM_INT, \PDO::PARAM_STR])) {
return function($object) use ($firstIdentifier) { return function($object) use ($firstIdentifier) {
if ($object) {
return call_user_func([$object, 'get' . ucfirst($firstIdentifier->getPhpName())]); return call_user_func([$object, 'get' . ucfirst($firstIdentifier->getPhpName())]);
}
return null;
}; };
} }
return null; return null;