Stuff
public php v1 · immutable $this->Course->bindModel(array('hasOne'=>array('CoursesPlace'=>array()))); $this->Course->bindModel(array('hasOne' => array('Module' => array()))); $array = $this->Course->findAll($conditions,'DISTINCT Course.id','Course.rank DESC'); $array = Set::extract($array, '{n}.Course.id'); $this->set('results', $this->Course->findAll(array('Course.id' => $array)));