$where=$this->tnames[$root]->getTableName().".id IN (SELECT ".$fk->getLocal()." FROM ".$asf->getTableName()." WHERE ".$fk->getForeign()." IN (".$graph->getQuery()."))";
"SELECT entity.id AS User__id, phonenumber.id AS Phonenumber__id FROM entity LEFT JOIN phonenumber ON entity.id = phonenumber.entity_id WHERE (entity.type = 0)");
...
...
@@ -157,13 +159,13 @@ class Doctrine_DQL_ParserTestCase extends Doctrine_UnitTestCase {
"SELECT entity.id AS User__id, email.id AS Email__id FROM entity, email WHERE (entity.email_id = email.id) AND (entity.type = 0)");
$this->assertEqual($users->count(),8);
$users=$graph->query("FROM Email WHERE Email.address LIKE '%@example%'");
$users=$graph->query("FROM Email-b WHERE Email.address LIKE '%@example%'");
$this->assertEqual($graph->getQuery(),
"SELECT email.id AS Email__id FROM email WHERE (email.address LIKE '%@example%')");
$this->assertEqual($users->count(),8);
...
...
@@ -184,7 +186,6 @@ class Doctrine_DQL_ParserTestCase extends Doctrine_UnitTestCase {
"SELECT entity.id AS User__id FROM entity LEFT JOIN phonenumber ON entity.id = phonenumber.entity_id WHERE (phonenumber.phonenumber REGEXP '[123]') AND (entity.type = 0)");
$this->assertEqual($users->count(),8);
$users=$graph->query("FROM User-b WHERE User.Group.name = 'Action Actors'");
$this->assertEqual(trim($graph->getQuery()),
"SELECT entity.id AS User__id FROM entity WHERE (entity.id IN (SELECT user_id FROM groupuser WHERE group_id IN (SELECT entity.id AS Group__id FROM entity WHERE (entity.name = 'Action Actors') AND (entity.type = 1)))) AND (entity.type = 0)");