ResultSetMapping addScalarResult associative array
<p>In my project with Symfony2, I'm using Doctrine createNativeQuery, and I would like to get an associative array.</p>

<p>This is my code</p>

<pre class="lang-php prettyprint-override"><code>$rsm = new ResultSetMapping;
$rsm-&gt;addScalarResult('id', 'id');
$rsm-&gt;addScalarResult('name', 'name');
$rsm-&gt;addScalarResult('phone_one', 'phoneOne');
$rsm-&gt;addScalarResult('phone_two', 'phoneTwo');
</code></pre>

<p>I have this result:
</p>

<pre><code>array:2 [
    0 =&gt; array:4 [
        "id" =&gt; "975"
        "name" =&gt; "one name"
        "phoneOne" =&gt; "122345556"
        "phoneTwo" =&gt; "345566789"
    ]
  1 =&gt; array:4 [
    0 =&gt; array:4 [
        "id" =&gt; "976"
        "name" =&gt; "two name"
        "phoneOne" =&gt; "122345556"
        "phoneTwo" =&gt; "345566789"
    ]
]
</code></pre>

<p>It's posible this result?
</p>

<pre><code>array:2 [
    0 =&gt; array:4 [
        "id" =&gt; "975"
        "name" =&gt; "one name"
        "phones" =&gt; [
            "phoneOne" =&gt; "122345556"
            "phoneTwo" =&gt; "345566789"
        ]
    ]
  1 =&gt; array:4 [
    0 =&gt; array:4 [
        "id" =&gt; "976"
        "name" =&gt; "two name"
        "phones" =&gt; [
            "phoneOne" =&gt; "122345556"
            "phoneTwo" =&gt; "345566789"
        ]
    ]
]
</code></pre>

<p>Thanks a lot</p>