function _Course::load_course_from_name

4.x _Course.php _Course::load_course_from_name($subject_id, $course_num)
5.x _Course.php _Course::load_course_from_name($subject_id, $course_num)

Load $this as a new course based on the subject_id and course_num, instead of the course_id. This is a useful function for when you know a subject_id and course_num, but not course_id (for example, if it comes from human input).

Parameters

string $subject_id:

string $course_num:

File

classes/_Course.php, line 723

Class

_Course

Code

function load_course_from_name($subject_id, $course_num) 
 {
  // Load a course based on its name.  In otherwords,
  // find the CourseID this way first.
  $course_id = $this->db->get_course_id($subject_id, $course_num);
  $this->load_course($course_id);
}