Skip to content

Instantly share code, notes, and snippets.

@ceeram
Created August 30, 2013 23:44
Show Gist options
  • Save ceeram/6395301 to your computer and use it in GitHub Desktop.
Save ceeram/6395301 to your computer and use it in GitHub Desktop.
setDbConfig
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