function CourseList::get_fulfilled_or_advised

7.x CourseList.php CourseList::get_fulfilled_or_advised($bool_return_new_courses = false)
6.x CourseList.php CourseList::get_fulfilled_or_advised($bool_return_new_courses = false)

Returns a CourseList of all the fulfilled or advised courses in $this's list.

Parameters

bool $bool_return_new_courses:

  • Works the same as get_clone()'s boolReturnNewCourses variable.

Return value

Course

File

classes/CourseList.php, line 1980

Class

CourseList

Code

function get_fulfilled_or_advised($bool_return_new_courses = false) 
 {

  $rtn_list = new CourseList();

  for ($t = 0; $t < $this->count; $t++) 
   {
    $course = $this->array_list [$t];
    $add_course = $course;

    if ($bool_return_new_courses == true) 
     {
      $add_course = new Course();
      $add_course->course_id = $course->course_id;
    }

    if ($course->bool_advised_to_take == true) 
     {
      $rtn_list->add($add_course);
    }

    // Several ways to tell if a course is here by credit...
    if (!$course->course_list_fulfilled_by->is_empty) {
      $rtn_list->add($add_course);
    }
    else if ($course->grade != "") {
      $rtn_list->add($add_course);
    }
    else if ($course->get_bool_substitution() == true) {
      $rtn_list->add($add_course);
    }
  }

  return $rtn_list;

}