Deleted useless code in the ModelChoiceList form type

This commit is contained in:
Kévin Gomez 2014-02-09 14:00:27 +00:00
parent 0004c1761c
commit e8a9e22a18

View file

@ -405,19 +405,14 @@ class ModelChoiceList extends ObjectChoiceList
*/
private function getIdentifierValues($model)
{
if ($model instanceof ActiveRecordInterface) {
return array($model->getPrimaryKey());
}
// readonly="true" models do not implement ActiveRecordInterface.
if ($model instanceof ActiveRecordInterface && method_exists($model, 'getPrimaryKey')) {
return array($model->getPrimaryKey());
}
if (null === $model) {
return array();
}
if ($model instanceof ActiveRecordInterface) {
return array($model->getPrimaryKey());
}
return $model->getPrimaryKeys();
}