function _DegreePlan::find_group

4.x _DegreePlan.php _DegreePlan::find_group($group_id)
5.x _DegreePlan.php _DegreePlan::find_group($group_id)
2 calls to _DegreePlan::find_group()

File

classes/_DegreePlan.php, line 598

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