【发布时间】:2011-08-24 12:00:31
【问题描述】:
我有一个博客模型,它定义了 var $hasMany=array("Comment");
如何对评论应用过滤器以仅选择与特定评论类别匹配的博客项目?
如果在博客模型中,我愿意
$this->recursive=2;
$this->hasMany=array("Comment"); //in Comment i have $belongsTo("Blog")
return $this->find("all",array("conditions"=>array("Comment.comment_type_id"=>123)));
我收到一条错误消息,显示 Unknown Comment.comment_type_id 列,因为 Cake 没有加入。
我认为这是一个相当普遍的问题,所以我认为解决起来很简单,但我找不到好方法
【问题讨论】:
标签: cakephp