title: Using a arraycollection as a parameter in a doctrine query
body: <p>I have a ArrayCollection of status objects that I would now like to use as the IN parameter in a WHERE clause for a doctrine query. Here's my query code:</p>
  
  <pre><code>$query = $repository-&gt;createQueryBuilder('r')
                  -&gt;join('r.applicationStatus', 's')
                  -&gt;where('r.submitted IS NOT NULL')
                  -&gt;andWhere('r.created &gt;= :date')                  
                  -&gt;andWhere('r.created &lt; :date2')
                  -&gt;andWhere('s IN (:status)') // Here's the In statement
                  -&gt;orderBy('r.created', 'DESC')                
                  -&gt;setParameter('date', $appSearch-&gt;getDateFrom())
                  -&gt;setParameter('date2', $end)
                  -&gt;setParameter('status', $appSearch-&gt;getApplicationStatus()) //Here's the array collection
                  -&gt;getQuery();
  </code></pre>
  
  <p>However the query is returning zero records. For it to work I have to manually iterate through the $appSearch->getApplicationStatus() arraycollection and grab the status id's in a new array for the query to yield correct results at the moment - which feels very inefficient. </p>
  
  <p>What am I doing wrong?</p>