function Course::get_substitution_hours

6.x Course.php Course::get_substitution_hours($degree_id = 0)
7.x Course.php Course::get_substitution_hours($degree_id = 0)

Similar to the functions regarding display-- get the course substitution based on supplied degree_id. Set degree_id to -1 to just get the first one, if available.

1 call to Course::get_substitution_hours()
Course::get_hours in classes/Course.php
Figure out the number of hours this particular instance of the course is worth. In the case of variable hours, it will return the number of hours selected. If that does not exist, it will return the MIN HOURS.


classes/Course.php, line 265




function get_substitution_hours($degree_id = 0) {
  // If degree_id is zero, then use the course's currently req_by_degree_id.    
  if ($degree_id == 0) {
    $degree_id = $this->req_by_degree_id;

  if ($degree_id > 0) {
    return $this->get_details_by_degree($degree_id, "substitution_hours");
  else {
    if (isset($this->details_by_degree_array [$degree_id]["substitution_hours"])) {
      $x = $this->details_by_degree_array [$degree_id]["substitution_hours"];
      if ($x) {
        return $x;

  // Else, return boolean FALSE
  return FALSE;