Using CakePHP models/controllers properly I'd like to know if I'm doing this properly. Basically, I have 3 models: Student, Course, StudentCourse. I'm running into problems when I'm trying to sign a student up for a course (I've removed a lot of the non-important code - auth component, view, etc). 

// Courses Controller (ie: /courses/signup/6)
class CoursesController extends AppController {
        public function signup($id = null) {
            $this-&gt;Course-&gt;id = $id;
            if (!$this-&gt;Course-&gt;exists()) {
                throw new NotFoundException(__('Invalid course'));
            }

            // Let's check to see if the user can signup for the course
            if($this-&gt;Course-&gt;canSignupForCourse($this-&gt;Auth-&gt;user('id'))) {

            } else {
                $this-&gt;Session-&gt;setFlash(__('You cannot signup for that course.'), 'flash_error');      
                $this-&gt;redirect(array('controller' =&gt; 'pages', 'action' =&gt; 'calendar'));
            }
    }   
}

// Course Model:
class Course extends AppModel {
    // Class 'hasMany' StudentCourse
    // Class 'habtm' Student

    public function isOwnedBy($course, $user) {
        return $this-&gt;field('id', array('id' =&gt; $course, 'student_id' =&gt; $user)) === $course;
    }

    public function isApproved() {
        $course = $this-&gt;read(null);

        if($course['Course']['approved_by'] != 0) {
            return true;
        }

        return false;
    }

    public function isComplete() {
        $course = $this-&gt;read(null);

        if($course['Course']['completed'] != 0) {
            return true;
        }

        return false;
    }   

    public function canSignupForCourse($studentId) {    

        if(! $this-&gt;StudentCourse-&gt;isSignedUpForCourse($studentId) &amp;&amp; $this-&gt;isApproved() &amp;&amp; $this-&gt;isComplete()) {
            return true;
        }       

        return false;
    }

}

// Student Model
class Student extends AppModel {
    // Student 'hasMany' Course
    // Student 'hasMany' StudentCourse
}

// StudentCourse Model
class StudentCourse extends AppModel {
    // StudentCourse 'belongsTo' Student
    // StudentCourse 'belongsTo' Course
    public function isSignedUpForCourse($studentId = null, $courseId = null) {
        return $this-&gt;find('count', array('conditions' =&gt; array('StudentCourse.course_id' =&gt; $courseId, 'StudentCourse.student_id' =&gt; $studentId))) != 0 ? TRUE : FALSE;
    }   
}


Basically, am I going about this the right way, are my relationships correct, or, is there a better/easier way to figure out if a student can signup for a course.
To me your code and relations looks good! You removed the redundancy in your database by splitting the tables up. Your cake really looks cakes way to me!

Just make sure you actually do something with the exception thrown and it should be all good.



Edit : I know this is a little late, but I wanted to complete my answer for the sake of completeness.

Your code style looks pretty good to me. The functions names are well chose. What I mean by that is by putting verb first you make the function a lot easier to find and understand.

Also, putting the logic in the model is the good choice. Continue to keep thin controllers.