_CourseList::dec_specified_repeats

5.x _CourseList.php _CourseList::dec_specified_repeats(Course $course, $bool_ignore_infinite_repeats = TRUE)
4.x _CourseList.php _CourseList::dec_specified_repeats(Course $course)

Go through the list and decrement the specified_repeats value for all instances of Course $course.

Parameters

Course $course:

File

classes/_CourseList.php, line 2500

Class

_CourseList

Code

function dec_specified_repeats(Course $course, $bool_ignore_infinite_repeats = TRUE) {
  // Go through the list, and decrement the specified_repeats
  // value for all instances of $course.
  for ($t = 0; $t < $this->count; $t++) {
    $course2 = $this->array_list[$t];
    if ($course2->course_id == $course->course_id) {

      if ($bool_ignore_infinite_repeats && $course2->specified_repeats == Group::GROUP_COURSE_INFINITE_REPEATS) {
        continue;
      }

      $course2->specified_repeats--;
    }
  }

}