title: CakePHP model that references itself
body: <p>I have the following situation. I have a model that refers to a database table called <code>questions</code>.  The questions table contains a key reference called <code>parent_id</code>, so a question can have a parent. This parent is a question record in the same table. This is because some questions are really a bundle of questions that the end user needs to see together.</p>
  
  <p>I have tried to model this behavior in my database as followed:</p>
  
  <pre><code> public $hasMany = array(
      'AttemptedQuestions' =&gt; array( 'classname' =&gt;   'AttemptedQuestions' ),
      'Questions' =&gt; array('className'=&gt;'Questions', 'foreignKey'=&gt;'parent_id')
  );
  </code></pre>
  
  <p>Edit: So the weird thing is that in the questions controller I can reference my data just fine as followed: </p>
  
  <pre><code>$test_question = $this-&gt;Question-&gt;find('all', array('conditions' =&gt; array('id' =&gt; 25)));
  </code></pre>
  
  <p>This will do exactly what I want. I am returned an array of data that has a question and its children. Accessing as <code>$test_question['Questions']</code> for the questions <code>$test_question['Children']</code> for the questions that have the <code>parent_id</code> of the parent question. What I do not understand is that if I reference this model in another controller like <code>Tests</code>, it does not return the children's array. Only the questions part is returned. How is the data returned from the model dependent on the controller you are in? This behavior seems odd and I want to know how to get the children from the database as well. Thank you for your time.</p>