$where=$this->tnames[$root]->getTableName().".id IN (SELECT ".$fk->getLocal()." FROM ".$asf->getTableName()." WHERE ".$fk->getForeign()." IN (".$graph->getQuery()."))";
$where=$this->tnames[$root]->getTableName().".".$this->tnames[$root]->getIdentifier()." IN (SELECT ".$fk->getLocal()." FROM ".$asf->getTableName()." WHERE ".$fk->getForeign()." IN (".$graph->getQuery()."))";
$this->join[$tname]="LEFT JOIN ".$tname2." ON ".$tname.".".$fk->getLocal()." = ".$tname2.".".$fk->getForeign();
$this->join[$tname]="LEFT JOIN ".$tname2." ON ".$tname.".".$fk->getLocal()." = ".$tname2.".".$fk->getForeign();
$this->joined[]=$tname2;
$this->joined[]=$tname2;
$this->from[$tname]=true;
$this->from[$tname]=true;
...
@@ -800,12 +801,12 @@ class Doctrine_DQL_Parser {
...
@@ -800,12 +801,12 @@ class Doctrine_DQL_Parser {
$asf=$fk->getAssociationFactory();
$asf=$fk->getAssociationFactory();
switch($fk->getType()):
switch($fk->getType()):
caseDoctrine_Table::ONE_AGGREGATE:
caseDoctrine_Relation::ONE_AGGREGATE:
caseDoctrine_Table::ONE_COMPOSITE:
caseDoctrine_Relation::ONE_COMPOSITE:
break;
break;
caseDoctrine_Table::MANY_AGGREGATE:
caseDoctrine_Relation::MANY_AGGREGATE:
caseDoctrine_Table::MANY_COMPOSITE:
caseDoctrine_Relation::MANY_COMPOSITE:
//$this->addWhere("SELECT ".$fk->getLocal()." FROM ".$asf->getTableName()." WHERE ".$fk->getForeign()." IN (SELECT ".$fk->getTable()->getComponentName().")");
//$this->addWhere("SELECT ".$fk->getLocal()." FROM ".$asf->getTableName()." WHERE ".$fk->getForeign()." IN (SELECT ".$fk->getTable()->getComponentName().")");
thrownewDoctrine_Exception("Couldn't call Doctrine::set(), second argument should be an instance of Doctrine_Collection when setting one-to-many references.");
thrownewDoctrine_Exception("Couldn't call Doctrine::set(), second argument should be an instance of Doctrine_Collection when setting one-to-many references.");
$value->setReference($this,$fk);
$value->setReference($this,$fk);
break;
break;
caseDoctrine_Table::ONE_COMPOSITE:
caseDoctrine_Relation::ONE_COMPOSITE:
caseDoctrine_Table::ONE_AGGREGATE:
caseDoctrine_Relation::ONE_AGGREGATE:
// one-to-one relation found
// one-to-one relation found
if(!($valueinstanceofDoctrine_Record))
if(!($valueinstanceofDoctrine_Record))
thrownewDoctrine_Exception("Couldn't call Doctrine::set(), second argument should be an instance of Doctrine_Record when setting one-to-one references.");
thrownewDoctrine_Exception("Couldn't call Doctrine::set(), second argument should be an instance of Doctrine_Record when setting one-to-one references.");