title: nesting conditions with DQL
body: <p>Now that I've read all the DQL docs I still have some doubts, I'm
  trying to do some nested condictions in my DQL however playing around
  with DQL I can't seem to be able to archive them</p>
  
  <p>To make myself more clear:</p>
  
  <p>I have this DQL query</p>
  
  <pre><code>    $q = Doctrine_Query::create()
          -&gt;select('c.nombre,c.webpage')
          -&gt;addSelect('COUNT(m.marca_id) as total_marcas')
          -&gt;from('Corporativos c')
          -&gt;leftJoin('c.Marcas m')
          -&gt;groupBy('c.corporativo_id')
          -&gt;where('ISNULL(c.deleted_at)')
          -&gt;orwhere('c.nombre LIKE :nombre', array(':nombre'=&gt;'%'.$srch))
          -&gt;orWhere('c.nombre LIKE :nombre', array(':nombre'=&gt;'%'.$srch.'%'))
          -&gt;orWhere('c.nombre LIKE :nombre', array(':nombre'=&gt;$srch.'%'))
          -&gt;orderBy('c.nombre ASC')
          -&gt;limit(0,20);
  </code></pre>
  
  <p>now this generates the following MySQL query:</p>
  
  <pre><code>SELECT c.corporativo_id AS c__corporativo_id, c.nombre AS c__nombre,
  c.webpage AS c__webpage, COUNT(m.marca_id) AS m__0 FROM corporativos c
  LEFT JOIN marcas m ON c.corporativo_id = m.corporativo_id WHERE
  (ISNULL(c.deleted_at) OR c.nombre LIKE :nombre OR c.nombre
  LIKE :nombre OR c.nombre LIKE :nombre) GROUP BY c.corporativo_id ORDER
  BY c.nombre ASC
  </code></pre>
  
  <p>However I'm getting a set of results where either deleted_at is null
  or the other conditions is completed, I'd like to make the
  isnull(deleted_at) obligatory, if we were talking in terms of SQL the
  query would look like this:</p>
  
  <pre><code>SELECT c.corporativo_id AS c__corporativo_id, c.nombre AS c__nombre,
  c.webpage AS c__webpage, COUNT(m.marca_id) AS m__0 FROM corporativos c
  LEFT JOIN marcas m ON c.corporativo_id = m.corporativo_id WHERE
  (ISNULL(c.deleted_at) AND (c.nombre LIKE :nombre OR c.nombre
  LIKE :nombre OR c.nombre LIKE :nombre)) GROUP BY c.corporativo_id
  ORDER BY c.nombre ASC
  </code></pre>
  
  <p>you can see that I just changed the first OR statement for an AND and
  added a couple of parenthesis to group the LIKE conditions.</p>
  
  <p>Is it posible to archivie this in DQL using the same ->where()
  notation avoiding writing down the whole condition ?</p>
  
  <p>thanks :)</p>