I cannot resolve how to call a model query function into a controller. I've been through too much documentation to count. Maybe I am wrong in what I am trying to do altogether? Continue to get MySQL errors (errors below).
Plan :: Model:
function getActive()
{
$findParameters = array(
'limit' => 10,
'order' => array('Plan.monthly_cost' => 'asc'),
'conditions' => array('PlanDetail.active' => 1)
);
return $this->find('all', $findParameters);
}
Plan :: Controller:
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));
}
Notice (8): Array to string conversion [ROOT.... Warning (512): SQL Error: 1054: Unknown column 'Plan' in 'where clause'