1
0
mirror of synced 2025-01-08 10:07:10 +03:00
This commit is contained in:
Michaël Gallego 2014-01-20 10:06:43 +01:00
parent f03f991a25
commit 6cbd643d4b
2 changed files with 9 additions and 5 deletions

View File

@ -587,12 +587,11 @@ class ManyToManyPersister extends AbstractCollectionPersister
. ' WHERE ' . implode(' AND ', $whereClauses);
$stmt = $this->conn->executeQuery($sql, $params);
$hydrator = $this->em->newHydrator(Query::HYDRATE_ARRAY);
$hydrator = $this->em->newHydrator(Query::HYDRATE_OBJECT);
$rsm = new Query\ResultSetMapping();
$rsm->addEntityResult($mapping['targetEntity'], 'r');
$result = $hydrator->hydrateAll($stmt, $rsm);
var_dump($result);
return $hydrator->hydrateAll($stmt, $rsm);
}

View File

@ -389,9 +389,14 @@ class ManyToManyBasicAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCa
$groups = $user->groups;
$this->assertFalse($user->groups->isInitialized(), "Pre-condition: lazy collection");
$criteria = Criteria::create();//->where(Criteria::expr()->eq('name', (string) 'Developers_0'));
$criteria = Criteria::create()->where(Criteria::expr()->eq('name', (string) 'Developers_0'));
$result = $groups->matching($criteria);
//$this->assertCount(1, $result);
$this->assertCount(1, $result);
$firstGroup = $result->first();
$this->assertEquals('Developers_0', $firstGroup->name);
$this->assertFalse($user->groups->isInitialized(), "Post-condition: matching does not initialize collection");
}
}