如何在CakePHP中获取关联模型的belongsTo?
我有一个名为Collection的模型,它有许多CollectionItem。CollectionItem有一个列表 所以基本上,集合->集合项->列表 当我对集合进行查找时,会得到关联的CollectionItem。但是,如何将列表附加到CollectionItem如何在CakePHP中获取关联模型的belongsTo?,cakephp,cakephp-2.0,Cakephp,Cakephp 2.0,我有一个名为Collection的模型,它有许多CollectionItem。CollectionItem有一个列表 所以基本上,集合->集合项->列表 当我对集合进行查找时,会得到关联的CollectionItem。但是,如何将列表附加到CollectionItem 从本质上讲,我怎样才能更深入一层呢?我已尝试将recursive on Collection设置为2,但不起作用。我将recursive更改为3级。我将recursive更改为3级。更好的解决方案是使用。更好的解决方案是使用。 C
从本质上讲,我怎样才能更深入一层呢?我已尝试将recursive on Collection设置为2,但不起作用。我将recursive更改为3级。我将recursive更改为3级。更好的解决方案是使用。更好的解决方案是使用。
- Collection有许多CollectionItem
- Collectionitem有一个列表
- 可容纳的集合动作
- 集合项目活动可包含
- 列表ACTSA可包含
$this->Collection->find('all', array(
'conditions' => array(), # your conditions
'contain' => array(
'CollectionItem',
'CollectionItem.Listing',
),
));
- Collection有许多CollectionItem
- Collectionitem有一个列表
- 可容纳的集合动作
- 集合项目活动可包含
- 列表ACTSA可包含
$this->Collection->find('all', array(
'conditions' => array(), # your conditions
'contain' => array(
'CollectionItem',
'CollectionItem.Listing',
),
));