function Group::get_is_min_hours_allowed_fulfilled

7.x Group.php Group::get_is_min_hours_allowed_fulfilled($semester_num = -1)
6.x Group.php Group::get_is_min_hours_allowed_fulfilled($semester_num = -1)

Return TRUE or FALSE if we've fulfilled the min hour allowed value, if it's set.

File

classes/Group.php, line 192

Class

Group

Code

function get_is_min_hours_allowed_fulfilled($semester_num = -1) {

  // TODO: Could call this->has_min_hours_allowed() instead if these lines?
  if ($this->min_hours_allowed === Group::GROUP_MIN_HOURS_NOT_SET) {
    return TRUE; // Wasn't set, so return TRUE
  }
  if (floatval($this->min_hours_allowed) == 0) {
    return TRUE; // Either wasn't set or it's set to zero, so return TRUE  (possibly delete this line?)
  }


  $v = $this->get_fulfilled_hours(true, true, false, $semester_num);

  if ($v >= $this->min_hours_allowed) {
    return TRUE; // Our fulfilled number of hours is >= the min_hours of this group.
  }

  return FALSE;

}