モデル クエリ関数をコントローラーに呼び出す方法を解決できません。私は数え切れないほど多くの文書を調べてきました。たぶん、私がやろうとしていることは間違っていますか?引き続き MySQL エラーが発生します (以下のエラー)。
プラン :: モデル:
function getActive()
{
$findParameters = array(
'limit' => 10,
'order' => array('Plan.monthly_cost' => 'asc'),
'conditions' => array('PlanDetail.active' => 1)
);
return $this->find('all', $findParameters);
}
プラン :: コントローラ:
function search() {
$this->Plan->recursive = 2; //*** Modified by Jason: Recursion needs to be corrected with better method. ***//
$active = $this->Plan->getActive();
$this->set('plans', $this->paginate($active));
}
注意 (8): 配列から文字列への変換 [ROOT.... 警告 (512): SQL エラー: 1054: 不明な列 'Plan' in 'where clause'