thrownewInvalidTypeException("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.");
thrownewInvalidTypeException("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.");
thrownewInvalidTypeException("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.");
@@ -85,7 +85,7 @@ class Doctrine_DQL_ParserTestCase extends Doctrine_UnitTestCase {
$this->clearCache();
$users=$graph->query("FROM User, User.Phonenumber-l WHERE User.Phonenumber.phonenumber LIKE '%123%'");
$users=$graph->query("FROM User-b, User.Phonenumber-l WHERE User.Phonenumber.phonenumber LIKE '%123%'");
$this->assertEqual(trim($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 (phonenumber.phonenumber LIKE '%123%') AND (entity.type = 0)");
...
...
@@ -141,7 +141,7 @@ class Doctrine_DQL_ParserTestCase extends Doctrine_UnitTestCase {
"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,7 +157,7 @@ class Doctrine_DQL_ParserTestCase extends Doctrine_UnitTestCase {
$users=$graph->query("FROM User, User.Email");
$users=$graph->query("FROM User-b, User.Email");
$this->assertEqual(trim($graph->getQuery()),
"SELECT entity.id AS User__id, email.id AS Email__id FROM entity, email WHERE (entity.email_id = email.id) AND (entity.type = 0)");
...
...
@@ -168,31 +168,31 @@ class Doctrine_DQL_ParserTestCase extends Doctrine_UnitTestCase {
"SELECT email.id AS Email__id FROM email WHERE (email.address LIKE '%@example%')");
$this->assertEqual($users->count(),8);
$users=$graph->query("FROM User WHERE User.name LIKE '%Jack%'");
$users=$graph->query("FROM User-b WHERE User.name LIKE '%Jack%'");
$this->assertTrue($graph->getQuery()=="SELECT entity.id AS User__id FROM entity WHERE (entity.name LIKE '%Jack%') AND (entity.type = 0)");
$this->assertEqual($users->count(),0);
$users=$graph->query("FROM User ORDER BY User.name ASC, User.Email.address");
$users=$graph->query("FROM User-b ORDER BY User.name ASC, User.Email.address");
$this->assertEqual(trim($graph->getQuery()),
"SELECT entity.id AS User__id FROM entity, email WHERE (entity.email_id = email.id) AND (entity.type = 0) ORDER BY entity.name ASC, email.address");
$users=$graph->query("FROM User WHERE User.Phonenumber.phonenumber REGEXP '[123]'");
$users=$graph->query("FROM User-b WHERE User.Phonenumber.phonenumber REGEXP '[123]'");
$this->assertEqual(trim($graph->getQuery()),
"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 WHERE User.Group.name = 'Action Actors'");
$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)");
$users=$graph->query("FROM User WHERE User.Group.Phonenumber.phonenumber LIKE '123 123'");
$users=$graph->query("FROM User-b WHERE User.Group.Phonenumber.phonenumber LIKE '123 123'");
$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, phonenumber WHERE (phonenumber.phonenumber LIKE '123 123') AND (entity.type = 1)))) AND (entity.type = 0)");