title: cakephp OR condition
body: <p>Originaly <a href="http://ask.cakephp.org/questions/view/how_to_revert_back_to_something_with_conditions">posted</a> on cakephp Q&amp;A but i'll put it up here in hope of getting some answers.</p>
  
  <p>I have a bunch of companies that has a status of 0 as default but sometimes get a higher status. Now i want to use the high status if exists but revert to 0 if not. i have tried a bunch of different approaches but i always get either only the ones with status 0 or the ones with the status i want, never giving me status if exists and 0 if not.</p>
  
  <p>Gives me only the status i specify, not giving me the ones with status 0:</p>
  
  <pre><code>'Company' =&gt; array (
      'conditions' =&gt;  array (
          'OR' =&gt; array(
              'Company.status' =&gt; 0,
              'Company.status' =&gt; $status,
          )
  
      )
  )
  </code></pre>
  
  <p>Gives me only status of 0:</p>
  
  <pre><code>'Company' =&gt; array (
      'conditions' =&gt;  array (
          'OR' =&gt; array(
              'Company.status' =&gt; $status,
              'Company.status' =&gt; 0
          )
      )
  )
  </code></pre>
  
  <p>Status definition and retrieving data in code:</p>
  
  <pre><code>function getCountry($id = null, $status = null) {
      // Bunch of code for retrieving country with $id and all it's companies etc, all with status 0.
      $status_less_companies = $this-&gt;Country-&gt;find...
  
      if ($status) {
          $status_companies = $this-&gt;Country-&gt;find('first', array(
              'conditions' =&gt; array(
                  'Country.id' =&gt; $id
              ),
              'contain' =&gt; array(
                  'Product' =&gt; array (
                      'Company' =&gt; array (
                          'conditions' =&gt;  array (
                              'OR' =&gt; array(
                                  'Company.status' =&gt; $status,
                                  'Company.status' =&gt; 0
                              )
                          )
                      )
                  )
              )
          )
      }
  
      // Mergin $status_less_companies and $status_companies and returning data to flex application.
  }
  </code></pre>
  
  <p>I changed the name for the models for this question just to make more sense, people are generaly frighten away when i tell them i work with cakephp for my flex application. I guess the logic to this question doesn't make sense but trust me that it makes sense in my application.</p>
  
  <p>Thanks!</p>