我正在努力让它发挥作用:
$this->Attempt->contain(array('AttemptedQuestion' => array('Question'=>array('Category') ))); //THIS DOESNT WORK
$attempt_to_be_graded = $this->Attempt->findById( $attempt_id );
结果数据的结构如下(无类别):
array(
Attempt => array(),
AttemptedQuestion => array(
0 => array(
Question => array()
),
1 => array(
Question => array()
),
2 => array(
Question => array()
)
)
)
我认为我的模型关联必须是正确的,因为这很好用:
$categories = $this->Attempt->AttemptedQuestion->Question->Category->find('all');
为什么上面返回的数据中没有Category数据?