title: Symfony2 findBy+indexBy
body: <p>In query builder you can specify which field should be used as array index:</p>
  <pre><code>$qb = $em-&gt;createQueryBuilder();
  $qb-&gt;select('s');
  $qb-&gt;from('models\Settings', 's', 's.key');  // here the magic
  $result = $qb-&gt;getQuery()-&gt;getResult();
  //here $result[key] is entity 
  </code></pre>
  <p>Anybody knows how to add indexBy(not in DB, but index of array of results)  to the findBy method, or make findBy-like method for repository, something like:</p>
  <pre><code>$clients = $clientRepository-&gt;findBy(['id' =&gt; $clients], [indexBy=&gt;id]);
  </code></pre>
  <p>OR</p>
  <pre><code>$clients = $clientRepository-&gt;myFindByWithIndexBy(['id' =&gt; $clients], 'id');
  </code></pre>
  <p>I need a method with filter criteria (where) and it should return entities indexed by id.</p>