_CourseList::mark_as_displayed

5.x _CourseList.php _CourseList::mark_as_displayed($semester_num = -1)
4.x _CourseList.php _CourseList::mark_as_displayed($semester_num = -1)

Mark every course in this list as bool_has_been_displayed = true. Used for making sure we don't display the same course twice on screen.

Returns FALSE if we did not mark any courses.

Parameters

int $semester_num:

  • If > -1, we will first make sure the course falls into this semesterNum. This way we can only perform this operation on a particular semester.

Return value

bool

File

classes/_CourseList.php, line 1597

Class

_CourseList

Code

function mark_as_displayed($semester_num = -1) {

  $temp_i = $this->i; // preserve the counter.
  $this->reset_counter();
  $rtn = false;
  while ($this->has_more()) {
    $c = $this->get_next();
    if ($semester_num != -1) { // A semesterNum was specified.
      // Make sure the course is in the correct semester.
      if ($c->assigned_to_semester_num != $semester_num) {
        continue;
      }
    }

    $c->bool_has_been_displayed = true;
    $rtn = true;

  }

  $this->i = $temp_i;
  return $rtn;
}