function _CourseList::remove_unfulfilled_courses

4.x _CourseList.php _CourseList::remove_unfulfilled_courses()
5.x _CourseList.php _CourseList::remove_unfulfilled_courses()

Removes courses from this list which have not been fulfilled (ther course_list_fulfilled_by is empty).

File

classes/_CourseList.php, line 1873

Class

_CourseList

Code

function remove_unfulfilled_courses() 
 {
  // remove courses in THIS list
  // which have nothing in their course_list_fulfilled_by
  // object.
  $rtn_list = new CourseList();
  for ($t = 0; $t < $this->count; $t++) 
   {
    $course = $this->array_list [$t];
    if ($course->course_list_fulfilled_by->is_empty == false) 
     {
      $rtn_list->add($course);
    }
  }

  $this->array_list = $rtn_list->array_list;
  $this->reset_counter();

}