title: Linking two models with CakeDC Search Plugin
body: <p>I have a small problem that is me consuming days.
  I need made a search in two diferent models in CakePHP, i'm using CakeDC Search Plugin.The models are 'Desordens' and 'Sinonimos', the association is hasMany. One 'Desorden' hasMany 'Sinonymous':</p>
  
  <pre><code>public $hasMany = array(
      'Sinonimo' =&gt; array(
          'className' =&gt; 'Sinonimo',
          'foreignKey' =&gt; 'desorden_id',
          'dependent' =&gt; false,
          'conditions' =&gt; '',
          'fields' =&gt; '',
          'order' =&gt; '',
          'limit' =&gt; '',
          'offset' =&gt; '',
          'exclusive' =&gt; '',
          'finderQuery' =&gt; '',
          'counterQuery' =&gt; ''
      ),
  </code></pre>
  
  <p>So, i follow the example in CakeDC Docs an made this :</p>
  
  <pre><code>public $filterArgs = array(
      'busca' =&gt; array(
          'type' =&gt; 'like',
          'encode' =&gt; true,
          'before' =&gt; false,
          'after' =&gt; false,
          'field' =&gt; array(
              'Desorden.name',
              'Desorden.orphanumber',
              'Sinonimo.sinonimo')
      )
  );
  </code></pre>
  
  <p>What i want to do is a search where the user can insert the name,orphanumber or the synonymous.In SQL would be:</p>
  
  <pre><code>SELECT `Desorden`.`id`, `Desorden`.`name`, `Desorden`.`orphanumber`, `Desorden`.`expertlink`, `Desorden`.`tipodesordem`, `Desorden`.`descricao`, `Sinonimo`.`id`, `Sinonimo`.`sinonimo`, `Sinonimo`.`desorden_id` FROM `rederaras`.`desordens` AS `Desorden` LEFT JOIN `rederaras`.`sinonimos` AS `Sinonimo` ON (`Sinonimo`.`desorden_id` = `Desorden`.`id`) WHERE ((`Desorden`.`name` LIKE 'mult') OR (`Desorden`.`orphanumber` LIKE 'mult') OR (`Sinonimo`.`sinonimo` LIKE 'mult'))
  </code></pre>
  
  <p>But the table 'Sinonimo' its not being joined and i have the 1054 error:</p>
  
  <blockquote>
    <p>Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Sinonimo.sinonimo' in 'where clause'</p>
  </blockquote>
  
  <p>I don't know what i missing, the controller i have configured like this:</p>
  
  <pre><code>$this-&gt;Prg-&gt;commonProcess();
          $this-&gt;Desorden-&gt;recursive = 0;
          $this-&gt;Paginator-&gt;settings['conditions'] = $this-&gt;Desorden-&gt;parseCriteria($this-&gt;Prg-&gt;parsedParams());            
          $this-&gt;set('desordens', $this-&gt;Paginator-&gt;paginate());
  </code></pre>
  
  <p>I think its no problem in the model or cakedc filterArg configuration, because the query is constructed in the right way.I try to use bindModel to made a join between the tables 'Desordens' and 'Sinonimos' but no success....</p>
  
  <pre><code>$this-&gt;Desorden-&gt;bindModel(array(
              'hasMany' =&gt; array(
                  'Sinonimo' =&gt; array(
                      'foreignKey' =&gt; false,
                      'conditions' =&gt; array('Desorden.id = Sinonimo.desorden_id')
                  )
              )
          ), false);
  </code></pre>
  
  <p>Anyone can help me to made this join ?</p>
  
  <p>Thanks </p>