5.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 275




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;