Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Some suggestions:</p> <p>1.) Move recursive to PropertiesController right before <code>findById</code></p> <pre><code>$this-Property-&gt;recursive = 2; </code></pre> <p>2.) Use containable behavior on Bill and ExpenseType models</p> <pre><code>var $actsAs = array('Containable'); </code></pre> <p>...then in PropertiesController do...</p> <pre><code>$this-&gt;Property-&gt;contain(array( 'Bill' =&gt; array( 'ExpenseType' ) )); $this-&gt;set('property', $this-&gt;Property-&gt;findById($id)); </code></pre> <p><strong>UPDATE #1:</strong></p> <p>Bill Model</p> <pre><code>class Bill extends AppModel { /******************* * Variables * *******************/ var $actsAs = array('Containable'); /********************* * Model Associations * **********************/ public $belongsTo = array( 'Property' =&gt; array( 'className' =&gt; 'Property', 'foreignKey' =&gt; 'property_id', 'conditions' =&gt; '', 'fields' =&gt; '', 'order' =&gt; '' ), 'ExpenseType' =&gt; array( 'className' =&gt; 'ExpenseType', 'foreignKey' =&gt; 'expense_type_id', 'conditions' =&gt; '', 'fields' =&gt; '', 'order' =&gt; '' ), ); // end belongsTo } // end Bill model </code></pre> <p>ExpenseType Model</p> <pre><code>class ExpenseType extends AppModel { /******************* * Variables * *******************/ var $actsAs = array('Containable'); /******************* * Model Associations * *******************/ public $hasMany = array( 'Bill' =&gt; array( 'className' =&gt; 'Bill', 'foreignKey' =&gt; 'expense_type_id', 'conditions' =&gt; '', 'fields' =&gt; '', 'order' =&gt; '' ), ); // end hasMany } // end ExpenseType model </code></pre> <p>then clear cache</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload