function _FlightPath::replace_missing_course_in_group
Search API
4.x _FlightPath.php | _FlightPath::replace_missing_course_in_group($course_id, $group_id) |
5.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 1192
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.
// First, find the group.
if (!$group = $this->degree_plan->find_group($group_id))
{
fpm(" ~~ could not find group $group_id for replacemMissingCourseInGroup");
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);
}