mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Making Model::setSource() eager again to fix issues where joined models
would not have the table prefixes correctly configured. Fixes #1507
This commit is contained in:
parent
7f8c98d9de
commit
d20f68c44e
1 changed files with 1 additions and 3 deletions
|
@ -465,16 +465,14 @@ class Model extends Object {
|
|||
$this->Behaviors = new BehaviorCollection();
|
||||
|
||||
if ($this->useTable !== false) {
|
||||
|
||||
if ($this->useTable === null) {
|
||||
$this->useTable = Inflector::tableize($this->name);
|
||||
}
|
||||
$this->setSource($this->useTable);
|
||||
|
||||
if ($this->displayField == null) {
|
||||
unset($this->displayField);
|
||||
}
|
||||
$this->table = $this->useTable;
|
||||
$this->tableToModel[$this->table] = $this->alias;
|
||||
} elseif ($this->table === false) {
|
||||
$this->table = Inflector::tableize($this->name);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue