0
我有這個有一個模板的NPO表。模板又有一個主題。我想要檢索Npo
選擇哪個主題。加入蛋糕模型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中獲取任何東西。相反,它會爲此表寫入一個單獨的查詢,並且不會在連接中考慮它。
我已經設置recursive
水平3
請幫助。我真的不明白蛋糕協會是如何工作的。
問候 人士Himanshu夏爾馬
'belogsTo':你的意思是......'belongsTo'? – deceze 2011-12-21 08:44:45
對不起,我現在編輯它 – 2011-12-21 08:45:29