function DegreePlan::find_group

7.x DegreePlan.php DegreePlan::find_group($group_id)
6.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 1192

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;
}