$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->joined[]=$tname2;
$this->from[$tname]=true;
...
...
@@ -800,12 +801,12 @@ class Doctrine_DQL_Parser {
$asf=$fk->getAssociationFactory();
switch($fk->getType()):
caseDoctrine_Table::ONE_AGGREGATE:
caseDoctrine_Table::ONE_COMPOSITE:
caseDoctrine_Relation::ONE_AGGREGATE:
caseDoctrine_Relation::ONE_COMPOSITE:
break;
caseDoctrine_Table::MANY_AGGREGATE:
caseDoctrine_Table::MANY_COMPOSITE:
caseDoctrine_Relation::MANY_AGGREGATE:
caseDoctrine_Relation::MANY_COMPOSITE:
//$this->addWhere("SELECT ".$fk->getLocal()." FROM ".$asf->getTableName()." WHERE ".$fk->getForeign()." IN (SELECT ".$fk->getTable()->getComponentName().")");