mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixing errors with displayField
This commit is contained in:
parent
a13be623b5
commit
5d1e6f9e4f
1 changed files with 4 additions and 1 deletions
|
@ -468,7 +468,7 @@ class Model extends Object {
|
|||
}
|
||||
|
||||
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;
|
||||
|
@ -565,6 +565,9 @@ class Model extends Object {
|
|||
* @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};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue