Fixed #665.
This commit is contained in:
parent
532dea0dd2
commit
6a958bae47
@ -546,6 +546,17 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
|
|||||||
return $this->getCurrentConnection();
|
return $this->getCurrentConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hasConnectionForComponent
|
||||||
|
*
|
||||||
|
* @param string $componentName
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function hasConnectionForComponent($componentName = null)
|
||||||
|
{
|
||||||
|
return isset($this->_bound[$componentName]);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getTable
|
* getTable
|
||||||
* this is the same as Doctrine_Connection::getTable() except
|
* this is the same as Doctrine_Connection::getTable() except
|
||||||
|
@ -1649,8 +1649,10 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable, Seria
|
|||||||
public function loadRoot($name, $componentAlias)
|
public function loadRoot($name, $componentAlias)
|
||||||
{
|
{
|
||||||
// get the connection for the component
|
// get the connection for the component
|
||||||
$this->_conn = Doctrine_Manager::getInstance()
|
$manager = Doctrine_Manager::getInstance();
|
||||||
->getConnectionForComponent($name);
|
if ($manager->hasConnectionForComponent($name)) {
|
||||||
|
$this->_conn = $manager->getConnectionForComponent($name);
|
||||||
|
}
|
||||||
|
|
||||||
$table = $this->_conn->getTable($name);
|
$table = $this->_conn->getTable($name);
|
||||||
$tableName = $table->getTableName();
|
$tableName = $table->getTableName();
|
||||||
@ -1681,7 +1683,10 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable, Seria
|
|||||||
public function buildInheritanceJoinSql($name, $componentAlias)
|
public function buildInheritanceJoinSql($name, $componentAlias)
|
||||||
{
|
{
|
||||||
// get the connection for the component
|
// 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);
|
$table = $this->_conn->getTable($name);
|
||||||
$tableName = $table->getTableName();
|
$tableName = $table->getTableName();
|
||||||
|
Loading…
Reference in New Issue
Block a user