Created
August 30, 2013 23:44
-
-
Save ceeram/6395301 to your computer and use it in GitHub Desktop.
setDbConfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function setDbConfig($source = null, $useTable = null) { | |
$this->getDataSource()->flushMethodCache(); | |
if ($source) { | |
$this->oldSource = array('useTable' => $this->useTable, 'useDbConfig' => $this->useDbConfig); | |
$this->setDataSource($source); | |
if ($useTable !== null) { | |
$this->setSource($useTable); | |
} | |
} else { | |
if ($this->oldSource) { | |
$this->setDataSource($this->oldSource['useDbConfig']); | |
$this->setSource($this->oldSource['useTable']); | |
$this->oldSource = array(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment