1
0
mirror of synced 2024-12-13 14:56:01 +03:00
This commit is contained in:
romanb 2007-12-11 15:46:27 +00:00
parent 532dea0dd2
commit 6a958bae47
2 changed files with 19 additions and 3 deletions

View File

@ -545,6 +545,17 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
}
return $this->getCurrentConnection();
}
/**
* hasConnectionForComponent
*
* @param string $componentName
* @return boolean
*/
public function hasConnectionForComponent($componentName = null)
{
return isset($this->_bound[$componentName]);
}
/**
* getTable

View File

@ -1649,8 +1649,10 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable, Seria
public function loadRoot($name, $componentAlias)
{
// get the connection for the component
$this->_conn = Doctrine_Manager::getInstance()
->getConnectionForComponent($name);
$manager = Doctrine_Manager::getInstance();
if ($manager->hasConnectionForComponent($name)) {
$this->_conn = $manager->getConnectionForComponent($name);
}
$table = $this->_conn->getTable($name);
$tableName = $table->getTableName();
@ -1681,7 +1683,10 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable, Seria
public function buildInheritanceJoinSql($name, $componentAlias)
{
// get the connection for the component
$this->_conn = Doctrine_Manager::getInstance()->getConnectionForComponent($name);
$manager = Doctrine_Manager::getInstance();
if ($manager->hasConnectionForComponent($name)) {
$this->_conn = $manager->getConnectionForComponent($name);
}
$table = $this->_conn->getTable($name);
$tableName = $table->getTableName();