_Group::find_courses

5.x _Group.php _Group::find_courses(Course $course)
4.x _Group.php _Group::find_courses(Course $course)

File

classes/_Group.php, line 762

Class

_Group

Code

function find_courses(Course $course) {
  // Return a CourseList of all the Course objects
  // which are in this group that match
  $rtn_course_list = new CourseList();

  if ($obj_list = $this->list_courses->find_all_matches($course)) {
    $obj_list->reset_counter();
    while ($obj_list->has_more()) {
      $c = $obj_list->get_next();
      $c->required_on_branch_id = $this->group_id;
    }
    $rtn_course_list->add_list($obj_list);
    return $rtn_course_list;
  }

  return false;

}