function _CourseList::remove_unfulfilled_and_unadvised_courses

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

Removes courses which have neither been fulfilled or advised.

File

classes/_CourseList.php, line 1838

Class

_CourseList

Code

function remove_unfulfilled_and_unadvised_courses() 
 {
  // remove courses from THIS list
  // which have not been fulfilled AND
  // are not currently advised.
  $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) 
     {
      // something IS fulfilling it!
      $rtn_list->add($course);

    }
    else if ($course->bool_advised_to_take == true) 
     {
      // Was not being fulfilled, but, it was advised
      // to take.
      $rtn_list->add($course);
    }



  }

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