minor optimization to save one call to Helper::model() when creating forms.

This commit is contained in:
Mark Story 2010-04-14 21:00:00 -04:00
parent 99e5f4a49f
commit 8ef2a82a89

View file

@ -216,8 +216,9 @@ class FormHelper extends AppHelper {
$object =& $this->_introspectModel($model);
$this->setEntity($model . '.', true);
if (isset($this->fieldset[$this->model()]['key'])) {
$data = $this->fieldset[$this->model()];
$modelEntity = $this->model()
if (isset($this->fieldset[$modelEntity]['key'])) {
$data = $this->fieldset[$modelEntity];
$recordExists = (
isset($this->data[$model]) &&
!empty($this->data[$model][$data['key']])