title: writing query in cake php
body: <p>how to write the following query in cakephp 2.0 syntax</p>
  
  <pre><code>SELECT `customers`.*
  FROM `group_customers`, `customers`
  WHERE 
  `group_customers`.`customer_id`=`customers`.`id`
  AND `group_customers`.`group_id`=7
  AND
  (`customers`.`name` LIKE 'O%' OR `customers`.`company` LIKE 'O%')
  </code></pre>
  
  <p>where customers and group_customers are two table and have the Customer and Groupcustomer model</p>
  
  <p>plz help me to get the proper cakephp syntax as i tried using in the following way</p>
  
  <pre><code>this-&gt;Customer-&gt;find('all',array(
                  'joins' =&gt; array(
                  array(
                  'table' =&gt; 'group_customers',
                  'alias' =&gt; 'GroupCustomer',
                  'type' =&gt; 'INNER',
                  'conditions' =&gt; array(
                  'GroupCustomer.customer_id'=&gt;'Customer.id',
                  'GroupCustomer.group_id'=&gt;$grpid ))),
                  'conditions' =&gt; array('OR'=&gt;array('Customer.name LIKE'
                                   =&gt;$text.'%','Customer.company LIKE'=&gt;$text.'%'))
                      ));
  </code></pre>