mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-06-09 16:23:34 +00:00
Merge branch 'master' into 2.5
This commit is contained in:
commit
71312932e8
4 changed files with 22 additions and 19 deletions
lib/Cake/Model
|
@ -1127,10 +1127,13 @@ class Model extends Object implements CakeEventListener {
|
|||
public function setSource($tableName) {
|
||||
$this->setDataSource($this->useDbConfig);
|
||||
$db = ConnectionManager::getDataSource($this->useDbConfig);
|
||||
$db->cacheSources = ($this->cacheSources && $db->cacheSources);
|
||||
|
||||
if (method_exists($db, 'listSources')) {
|
||||
$restore = $db->cacheSources;
|
||||
$db->cacheSources = ($restore && $this->cacheSources);
|
||||
$sources = $db->listSources();
|
||||
$db->cacheSources = $restore;
|
||||
|
||||
if (is_array($sources) && !in_array(strtolower($this->tablePrefix . $tableName), array_map('strtolower', $sources))) {
|
||||
throw new MissingTableException(array(
|
||||
'table' => $this->tablePrefix . $tableName,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue