function _Course::has_variable_hours

4.x _Course.php _Course::has_variable_hours()
5.x _Course.php _Course::has_variable_hours()

Simply returns TRUE if $this has variable hours.

Return value

bool

2 calls to _Course::has_variable_hours()
_Course::get_catalog_hours in classes/_Course.php
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)
_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.

File

classes/_Course.php, line 535

Class

_Course

Code

function has_variable_hours() 
 {

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


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

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


  if ($min_h == $max_h) 
   {
    return false;
  }
  else {
    return true;
  }
}