mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Don't always wipe a Model's _schema property when calling setSource()
Only wipe the internal schema cache if listSources() returned a useful list of sources. Otherwise retain the old schema. This lets datasources that don't implement listSources to be combined with models that define static schema properties. Fixes #2467
This commit is contained in:
parent
ef899f0c93
commit
01be15d654
1 changed files with 3 additions and 1 deletions
|
@ -1140,8 +1140,10 @@ class Model extends Object implements CakeEventListener {
|
|||
));
|
||||
}
|
||||
|
||||
if ($sources) {
|
||||
$this->_schema = null;
|
||||
}
|
||||
}
|
||||
|
||||
$this->table = $this->useTable = $tableName;
|
||||
$this->tableToModel[$this->table] = $this->alias;
|
||||
|
|
Loading…
Reference in a new issue