Skip to content

Commit

Permalink
minor optimization to save one call to Helper::model() when creating …
Browse files Browse the repository at this point in the history
…forms.
  • Loading branch information
markstory committed Apr 15, 2010
1 parent 99e5f4a commit 8ef2a82
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cake/libs/view/helpers/form.php
Expand Up @@ -216,8 +216,9 @@ function create($model = null, $options = array()) {
$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']])
Expand Down

0 comments on commit 8ef2a82

Please sign in to comment.