0
하나의 템플릿이있는이 NPO 테이블이 있습니다. 템플릿에는 차례대로 테마가 있습니다. 어떤 테마가 Npo
에 의해 선택되었는지 검색하고 싶습니다.cake php에서 모델에 가입하기
나는 다음과 같은 한 관계 설정 :
NPO - npo.id = template.npoid 템플릿에 템플릿 - theme.id = template.template_theme_id
그리고 내가 사용에 테마 :
$this->Npo->bindmodel(array(
'hasOne' => array(
'NpoTemplate' => array(
'className' => 'NpoTemplate'
)
)
), false);
$this->NpoTemplate->bindmodel(array(
'hasOne' => array(
'TemplateTheme' => array(
'className' => 'TemplateTheme',
'fields' => 'TemplateTheme.html'
)
)
), false);
$arrUserSite = $this->Npo->find('first', array(
'conditions'=> array(
'Npo.address' => $user
)
));
그러나 TemplateTheme에서 아무 것도 가져 오지 않습니다. 대신이 테이블에 대해 별도의 쿼리를 작성하고 조인에서 고려하지 않습니다.
내가 도와주세요 3
에 recursive
수준을 설정했습니다. 나는 케이크 협회가 어떻게 작동하는지 정말로 모른다. 하나의 bindModel() 호출의 관계를 설정
감사 히만 슈 샤르마
'belogsTo' : 당신은 ...'belongsTo '를 원하셨습니까? – deceze
죄송합니다. 지금 편집했습니다. –