_DegreePlan::find_group

5.x _DegreePlan.php _DegreePlan::find_group($group_id)
4.x _DegreePlan.php _DegreePlan::find_group($group_id)
2 calls to _DegreePlan::find_group()
_DegreePlan::find_courses in classes/_DegreePlan.php
If degree_id != 0, then we will remove any course from the finished list that is NOT in the degree plan. 0 means "give me all of matches back"
_DegreePlan::load_degree_plan in classes/_DegreePlan.php
Load our complete degree plan, including all courses and groups.

File

classes/_DegreePlan.php, line 1175

Class

_DegreePlan

Code

function find_group($group_id) {
  // Locate the group with group_id in the
  // list of groups, and return it.
  $this->list_groups->reset_counter();
  while ($this->list_groups->has_more()) {
    $group = $this->list_groups->get_next();
    if ($group->group_id == $group_id) {
      return $group;
    }

    if (!$group->list_groups->is_empty) {
      $group->list_groups->reset_counter();
      while ($group->list_groups->has_more()) {
        $branch = $group->list_groups->get_next();
        if ($branch->group_id == $group_id) {
          return $branch;
        }
      }
    }

  }

  return false;
}