title: How to use andWhere and orWhere in Doctrine?
body: <pre><code>WHERE a = 1 AND (b = 1 Or b = 2) AND (c = 1 OR c = 2)
  </code></pre>
  
  <p>How can i make this in Doctrine?</p>
  
  <pre><code>$q-&gt;where("a = 1");
  $q-&gt;andWhere("b = 1")
  $q-&gt;orWhere("b = 2")
  $q-&gt;andWhere("c = 1")
  $q-&gt;orWhere("d = 2")
  </code></pre>
  
  <p>this isnt correctly... Should be:</p>
  
  <pre><code>$q-&gt;where("a = 1");
  $q-&gt;andWhere("b = 1")
     $q-&gt;orWhere("b = 2")
  $q-&gt;andWhere("c = 1")
     $q-&gt;orWhere("d = 2")
  </code></pre>
  
  <p>but how can i make it? In Propel is function <strong>getNewCriterion</strong>, and in Doctrine...?</p>