function _CourseList::mark_repeats_exclude

4.x _CourseList.php _CourseList::mark_repeats_exclude(Course $course)
5.x _CourseList.php _CourseList::mark_repeats_exclude(Course $course, $degree_id = 0, Course $except_for_course = NULL)

Go through the list and set the $bool_exclude_repeat flag to TRUE for all matches of $course in this list.

Returns FALSE if no matches could be found.

Parameters

Course $course:

Return value

bool

2 calls to _CourseList::mark_repeats_exclude()
_CourseList::find_best_grade_match in classes/_CourseList.php
Find a list of matches to Course courseC, which fulfill the min_grade requirement, ordered by most best grade first.
_CourseList::find_most_recent_match in classes/_CourseList.php
Find a list of matches to Course courseC, which fulfill the min_grade requirement, ordered by most recently taken.

File

classes/_CourseList.php, line 262

Class

_CourseList

Code

function mark_repeats_exclude(Course $course, $degree_id = 0, Course $except_for_course = NULL) 
 {
  // Set the bool_exclude_repeat flag to TRUE for all
  // occurances of $course in THIS list.

  if (!$list_matches = parent::find_all_matches($course)) 
   {
    return false;
  }

  $list_matches = CourseList::cast($list_matches);
  $list_matches->reset_counter();
  while ($list_matches->has_more()) 
   {
    $c = $list_matches->get_next();

    if ($except_for_course != NULL) {
      if ($c == $except_for_course) {
        // Skip it.
        continue;
      }
    }

    $c->set_bool_exclude_repeat($degree_id, TRUE);
  }

  return true;

}