5.x _Course.php _Course::load_course($course_id, $is_transfer = false)
4.x _Course.php _Course::load_course($course_id, $is_transfer = false)

Loads $this as a new course, based on course_id.


int $course_id:

bool $is_transfer:

3 calls to _Course::load_course()
_Course::load_course_from_data_string in classes/_Course.php
This will take a data string, as created by the function to_data_string(), and make $this object match the original object. It is a poor man's unserialize. See to_data_string()'s description for a fuller picture of what is going on.
_Course::load_course_from_name in classes/_Course.php
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).
_Course::__construct in classes/_Course.php
The constructor for a Course object.


classes/_Course.php, line 1306




function load_course($course_id, $is_transfer = false) {

  if ($this->db == NULL) {
    $this->db = get_global_database_handler();

  $catalog_line = "";
  if ($this->catalog_year != "") {
    $catalog_line = " AND catalog_year = '$this->catalog_year' ";

  if ($is_transfer == false) {
  else {
    // This is a transfer course.  Find out its eqv, if any...

    $res = $this->db->db_query("SELECT * FROM
										transfer_courses a,
										transfer_institutions b
									   a.transfer_course_id = '?' 
									   AND a.institution_id = b.institution_id ", $course_id);
    $cur = $this->db->db_fetch_array($res);
    $this->subject_id = $cur["subject_id"];
    $this->course_num = $cur["course_num"];
    $this->course_id = $course_id;
    $this->bool_transfer = true;
    $this->institution_id = $cur["institution_id"];
    $this->institution_name = $cur["name"];



  // When we load this course, let's also check for any hooks.
  // Since this class might be used outside of FP, only do this if we know
  // that the bootstrap.inc file has been executed.
  if ($GLOBALS["fp_bootstrap_loaded"] == TRUE) {
    invoke_hook("course_load", array(&$this));