title: Normalized data model - looking up simple joins in CakePHP
body: <p>I have the following data model</p>
  
  <pre><code>`Table: Workflow
  Field: workflow_id
  Field: workflow_name
  Field: workflow_step_id`
  
  `Table: Workflow_Step
  Field: workflow_step_id
  Field: workflow_step_name
  Field: workflow_id`
  
  `Table: Workflow_Step_Detail
  Field: workflow_step_detail_id
  Field: workflow_step_detail_name
  Field: country_id
  Field: state_id
  Field: workflow_step_id`
  </code></pre>
  
  <p>In the controller class</p>
  
  <pre><code>`&lt;?php 
   $this-&gt;set('workflow', $this-&gt;Workflow-&gt;findByWorkflowId(1)); // this works fine
  ?&gt;`
  </code></pre>
  
  <p>In the view file</p>
  
  <pre><code>`&lt;?php 
  $steps = $workflow['Workflow']['WorkflowStep']; //this gets all the steps
  $detail = $steps[0]['WorkflowStepDetail']; // this also works fine
  echo $detail['state_id']; //this also works fine
  echo $detail['state_name']; // this is what i want 
  ?&gt;`
  </code></pre>
  
  <p>As you can see from above, this is a highly normalized data model. My CakePHP data structure works fine with <code>hasMany</code> and <code>belongsTo</code> - it loads all the recursive data structures fine when I do <code>findByWorkflowId($id)</code>. However, when I want to display WorkflowStepDetails - i dont want to display just the <code>country_id</code> or <code>state_id</code> - I would like to display the corresponding name from the <code>country</code> and <code>state</code> lookup tables. I am unable to figure out how to make this join inherent within the CakePHP <code>findBy</code> structure</p>