title: Return an associative array with certain key for a findBy doctrine repository function
body: <p>I want this function </p>
  
  <pre><code>$entityManager
  -&gt;getRepository('AppBundle:Example')
  -&gt;findBy(array('id' =&gt; $id, 'active' =&gt; true));
  </code></pre>
  
  <p>to return an associative array of Example objects with <strong>ID as keys</strong>. 
  For example:</p>
  
  <pre><code>array(
      '100' =&gt; 'Example object 1',
      '135' =&gt; 'Example object 2'
  )
  </code></pre>
  
  <p>I can achieve this using <code>foreach</code> after retrieving the data, but I'd like to know if there is a proper way to do this.</p>