function FlightPath::replace_missing_course_in_group
Search API
7.x FlightPath.php | FlightPath::replace_missing_course_in_group($course_id, $group_id) |
6.x FlightPath.php | FlightPath::replace_missing_course_in_group($course_id, $group_id) |
1 call to FlightPath::replace_missing_course_in_group()
File
- classes/
FlightPath.php, line 1261
Class
Code
function replace_missing_course_in_group($course_id, $group_id)
{
// Given a group in the degree plan, this will
// make sure that course is actually in the group. If it
// is not, then it will add it in where it should be.
// This is necessary because we have previously removed
// courses which the student hadn't taken. Well, if the
// student was advised for a particular course in a group,
// then that course probably was originally removed
// from the group. So, put it back in.
// Were we given a valid group_id?
if (!$group_id) {
return;
}
// First, find the group.
if (!$group = $this->degree_plan->find_group($group_id))
{
fpm("Admin note: could not find group '$group_id' for replace_missing_course_in_group, for course '$course_id'.");
return;
}
// Okay, now tell the group to replace the instance of this course
// in the group. This is made easy, because we have
// the dbGroupRequirementID, which is the actual id from the
// row in group_requirements that this course was advised from.
$group->replace_missing_course($course_id);
}