title: How to create a NOT IN where clause Doctrine_Query?
body: <p>I am developing in symfony 1.4 using Doctrine ORM. I can't create a NOT IN where clause using an array with ids. This is my code:</p>
  
  <pre><code>$results = Doctrine_Query::create()
    -&gt;from('Asset a')
    -&gt;where('a.id NOT IN (?)', implode(',', $ids))
    -&gt;execute();
  </code></pre>
  
  <p>The sql for this query that is generated is this one: </p>
  
  <pre><code>WHERE (a.id NOT IN ('1,5,6,7,8,9,10,11,12,13,14,15,17,18,20,24,25,26,29,30,28'))
  </code></pre>
  
  <p>As you can see is treating the array filled with ids like an string. I tried also without the implode of the array but I get this error:</p>
  
  <pre><code>SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
  </code></pre>
  
  <p>The array $ids containing the excluded ids is a plain numeric one.</p>
  
  <p>I can't find out what is the correct syntax for this clause. Thanks</p>