From 220c6c4e0e0c50b95490a78a4422d23bdb66e8c0 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Tue, 13 Dec 2011 11:30:09 +0100 Subject: [PATCH] Fixing minor issues reported by BostjanWrk on IRC about the RSM Builder example --- en/reference/native-sql.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/en/reference/native-sql.rst b/en/reference/native-sql.rst index 01b837d4a..4afe2e2f2 100644 --- a/en/reference/native-sql.rst +++ b/en/reference/native-sql.rst @@ -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