I have 3 tables:
users:
id
first_name
last_name
courses:
id
name
student_courses:
id
student_id
course_id
paid
Users keeps track of the users, courses keep track of the courses, and student_courses is the table that shows what students have signed up for which courses. I currently have a "users" class and a "courses" class. My question is: Should I create a StudentCourses class to handle the interactions for the student_courses table?
ie: I need to create a function that gets all courses a user has signed up for, mark them as paid, etc.
Is it best to do:
$student = new User($userId);
$student->getCourses();
$student->markCourseAsPaid($courseId);
OR
$student = new User($userId);
$studentCourses = new StudentCourses($studentId);
$studentCourses->markCourseAsPaid($courseId);
etc.
