title: Doctrine DQL (Symfony2) - WHERE concatenated field is IN params
body: <p>I need to check if multiple items exists in a table. The problem is that I have to check strings in two fields concatenated togeher like if I would like to check first and last names together, but store them separately. I'm new to doctrine, and after an extensive research in the topic, I've tried two ways:</p>
  
  <pre><code>$params = array('two words', 'another here');
  
  // writing the DQL
  $query = $this-&gt;getEntityManager()
      -&gt;createQuery("
          SELECT foo.f1, foo.f2
          FROM MyCompanyMyBundle:MyEntity foo
          WHERE CONCAT(CONCAT(foo.f1, ' '), foo.f2) IN (:params)
      ")-&gt;setParameter('params', implode(', ', $params));
  </code></pre>
  
  <p><b>NOTE</b>: Double CONCAT is required becouse CONCAT_WS is not supported by Doctrine.</p>
  
  <p>This should work (imo) but :params is replaced by <b>one</b> string ( 'two words, another here' ), not a series of strings separated by a comma. (I Tried palcing individual apostrophes around the elements in $params but that doesn't work either, it gets escaped by Docrine ( '\'two words\', \'another here\'') ). </p>
  
  <pre><code>// trying the query builder
  
  $qb = $this-&gt;createQueryBuilder('foo');
  $query = $qb
      -&gt;select(array('foo.f1', 'foo.f2' ))
      -&gt;where(
          $qb-&gt;expr()-&gt;in(
              $qb-&gt;expr()-&gt;concat( $qb-&gt;expr()-&gt;concat('foo.f1', ' '), 'foo.f2'),
              ':params'
          )
      )
      -&gt;setParameter('params', implode(', ', $params))
      -&gt;getQuery();
  </code></pre>
  
  <p>I guess I'm not even close with the query builder, so if that is the way to go I appreciate any help!</p>
  
  <p>So my goal is to return the rows where the two columns values are correct together.</p>
  
  <p>Which is the way to go, and what am I doing wrong?</p>