function hook_courselist_find_match_allow_course

This hook his called just before returning a Course object from CourseList::find_best_grade_match or find_most_recent_match.

Returns TRUE or FALSE if the $candidate_course is allowed to match for the $needle_course.

File

includes/hook.api.php, line 176
Lists all available hooks within FlightPath's core code.

Code

function hook_courselist_find_match_allow_course(Course $candidate_course, Course $needle_course, CourseList $haystack_list_matches, $degree_id = 0, $group_id = 0) {

  if ($degree_id == 12345 && $candidate_course->name_equals('ART 101') && ($group_id != 0 && $group_id != '')) {
    return FALSE;
  }

  return TRUE;
}