From e8a9e22a188c0adefa6cd1d14131f71a327e0eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Gomez?= Date: Sun, 9 Feb 2014 14:00:27 +0000 Subject: [PATCH] Deleted useless code in the ModelChoiceList form type --- Form/ChoiceList/ModelChoiceList.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Form/ChoiceList/ModelChoiceList.php b/Form/ChoiceList/ModelChoiceList.php index 140105d..fbd26a8 100644 --- a/Form/ChoiceList/ModelChoiceList.php +++ b/Form/ChoiceList/ModelChoiceList.php @@ -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(); }