function _CourseList::get_previous_assignments

4.x _CourseList.php _CourseList::get_previous_assignments($course_id)
5.x _CourseList.php _CourseList::get_previous_assignments($course_id, $degree_id = 0)

Returns a CourseList of all the courses matching course_id that has bool_has_been_assigned == TRUE for the requested degree

Parameters

int $course_id:

Return value

CourseList

File

classes/_CourseList.php, line 1636

Class

_CourseList

Code

function get_previous_assignments($course_id, $degree_id = 0) 
 {
  // Return a courseList of all the times a course matching
  // course_id has the bool_has_been_assigned set to TRUE.

  $rtn_list = new CourseList();

  for ($t = 0; $t < $this->count; $t++) 
   {
    $course = $this->array_list [$t];
    if ($course->course_id == $course_id && $course->get_has_been_assigned_to_degree_id($degree_id) == true) 
     {
      $rtn_list->add($course);
    }
  }

  return $rtn_list;

}