function _Course::get_catalog_hours

4.x _Course.php _Course::get_catalog_hours()
5.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 334

Class

_Course

Code

function get_catalog_hours() 
 {

  if (!$this->has_variable_hours()) 
   {
    return $this->min_hours;
  }
  else {
    // Meaning this does course have variable hours.

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


    // 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";
  }
}