var $ hasMany = array ("Comment");를 정의한 블로그 모델이 있습니다.CakePHP : hasMany가있는 조건
특정 댓글 카테고리와 일치하는 블로그 항목 만 선택하려면 댓글에 필터를 적용하려면 어떻게해야합니까?
블로그 모델에서, 내가
$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)));
를 수행하면 난 케이크가 가입하지 않기 때문에 알 수없는 Comment.comment_type_id 열을 말한다 오류가 발생합니다.
나는 내가 해결하기 위해 간단하게 생각하지만 난 좋은 방법 당신은 반대로 작동 특정 카테고리의 모든 주석을 선택할 수