Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixing errors with displayField
  • Loading branch information
lorenzo committed Jul 16, 2010
1 parent a13be62 commit 5d1e6f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cake/libs/model/model.php
Expand Up @@ -468,7 +468,7 @@ function __construct($id = false, $table = null, $ds = null) {
}

if ($this->displayField == null) {
$this->displayField = $this->hasField(array('title', 'name', $this->primaryKey));
unset($this->displayField);
}
$this->table = $this->useTable;
$this->tableToModel[$this->table] = $this->alias;
Expand Down Expand Up @@ -565,6 +565,9 @@ public function __isset($name) {
* @return mixed value of requested variable if it is set
*/
function __get($name) {
if ($name === 'displayField') {
return $this->displayField = $this->hasField(array('title', 'name', $this->primaryKey));
}
if (isset($this->{$name})) {
return $this->{$name};
}
Expand Down

0 comments on commit 5d1e6f9

Please sign in to comment.