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 870

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