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,7 +1140,9 @@ class Model extends Object implements CakeEventListener {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_schema = null;
|
if ($sources) {
|
||||||
|
$this->_schema = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->table = $this->useTable = $tableName;
|
$this->table = $this->useTable = $tableName;
|
||||||
|
|
Loading…
Reference in a new issue