function Course::get_catalog_hours

7.x Course.php Course::get_catalog_hours()
6.x Course.php Course::get_catalog_hours()

The function returns either an integer of the the number of hours the course is worth, or, a range in the form of min-max (if the course has variable hours)

Examples: 3 or 1-6

Return value

string

File

classes/Course.php, line 880

Class

Course

Code

function get_catalog_hours() 
 {

  if (!$this->has_variable_hours()) 
   {
    // Normal course, no var hours.
    $h = $this->min_hours * 1;
    // check for ghost hours.
    if ($this->bool_ghost_min_hour) {
      $h = 0;
    }
    return $h;
  }
  else {
    // Meaning this does course have variable hours.

    $min_h = $this->min_hours * 1;
    $max_h = $this->max_hours * 1;


    // Convert back from ghosthours.
    if ($this->bool_ghost_min_hour) {
      $min_h = 0;
    }

    if ($this->bool_ghost_hour) {
      $max_h = 0;
    }


    return "$min_h-$max_h";
  }
}