1
0
mirror of synced 2025-01-19 06:51:40 +03:00

Merge pull request #63 from Ocramius/patch-2

Fixing minor issues reported by BostjanWrk on IRC about the RSM Builder ...
This commit is contained in:
Guilherme Blanco 2011-12-13 06:31:30 -08:00
commit e85ce5c02f

View File

@ -380,9 +380,9 @@ in your sQL statement:
$sql = "SELECT u.id, u.name, a.id AS address_id, a.street, a.city " .
"FROM users u INNER JOIN address a ON u.address_id = a.id";
$rsm = new ResultSetMappingBuilder;
$rsm = new ResultSetMappingBuilder($em);
$rsm->addRootEntityFromClassMetadata('MyProject\User', 'u');
$rsm->addJoinedEntityFromClassMetadata('MyProject\Address', 'a', array('id' => 'address_id'));
$rsm->addJoinedEntityFromClassMetadata('MyProject\Address', 'a', 'u', 'address', array('id' => 'address_id'));
For entites with more columns the builder is very convenient to use. It extends the ``ResultSetMapping`` class
and as such has all the functionality of it as well. Currently the ``ResultSetMappingBuilder`` does not support