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