1
- 사용자 모델을 가지고 - belongsTo를 광고 및 장소
- 장소 모델 - hasMany의의 placads
지금 나는이 같은 쿼리를 실행 :
$this->set(
'ad',
$this->User->Ad->find(
'all',
array(
'conditions' => array('Ad.user_id' => $this->Auth->user('id'))
)
)
);
내가 * 마크에 "장소"없이이 무엇입니까
[0] => Array
(
[Ad] => Array
(
[id] => 1
[user_id] => 1
[name] => bota
)
[Placad] => Array
(
[0] => Array
(
[id] => 1
[ad_id] => 1
[place_id] => 1
[count] => 10
*[Place] => Array
(
info about place
)*
)
[1] => Array
(
[id] => 2
[ad_id] => 1
[place_id] => 2
[count] => 20
*[Place] => Array
(
info about place
)*
)
)
)
내가이 * 마크에 쓴처럼 뭔가를 얻으려면 어떻게해야합니까?
미리 감사드립니다.
함유 성! :) containable은 멋진 기능입니다. –