title: Access related models/tables to inner join query in cakephp
body: <p>I have this <code>inner</code> <code>join</code> query in a paginated model called <code>Application</code></p>
  
  <p><code>Application</code> has many <code>AssignedExploration</code></p>
  
  <p><code>AssignedExploration</code> belongs to <code>Exploration</code></p>
  
  <p><code>Exploration</code> belongs to <code>ExplorationCategory</code></p>
  
  <p><code>ExplorationCategory</code> belongs to <code>Season</code></p>
  
  <p>My query so far is:</p>
  
  <pre><code>$session_condition = array(
      'table' =&gt; 'assigned_explorations',
      'alias' =&gt; 'AssignedExploration',
      'type' =&gt; 'INNER',
      'conditions' =&gt; array(
          'AssignedExploration.application_id = Application.id',
          'OR' =&gt; array(
              array('AssignedExploration.label' =&gt; $this-&gt;request-&gt;named['filter_session'])
          )
      )
  );
  </code></pre>
  
  <p>I would like to add another query inside the <code>OR</code> that will get <code>applications</code> which has a <code>Season.name = fall</code></p>
  
  <p>I've tried adding <code>array('Season.name' =&gt; 'fall')</code> :</p>
  
  <pre><code>$session_condition = array(
      'table' =&gt; 'assigned_explorations',
      'alias' =&gt; 'AssignedExploration',
      'type' =&gt; 'INNER',
      'conditions' =&gt; array(
          'AssignedExploration.application_id = Application.id',
          'OR' =&gt; array(
              array('AssignedExploration.label' =&gt; $this-&gt;request-&gt;named['filter_session']),
              array('Season.name' =&gt; 'fall')
          )
      )
  );
  </code></pre>
  
  <p>But no luck. Seems like Season is not recognized by <code>AssignedExploration</code>.</p>
  
  <p>I would like to nest from <code>AssignedExploration</code> to <code>Exploration</code> to <code>ExplorationCategory</code> and to <code>Season</code></p>
  
  <p>And I don't have any idea on how to make it thru <code>inner</code> <code>join</code> query via cakephp.</p>
  
  <p>Thanks in advanced.</p>
  
  <p>EDIT: query as of now:</p>
  
  <pre><code>INNER JOIN 
      `ntc_development`.`assigned_explorations` AS `AssignedExploration` ON ( 
          `AssignedExploration`.`application_id` = `Application`.`id` 
           AND 
           `AssignedExploration`.`label` = 'fall'
       )
  </code></pre>