You are here

public function Course::getObjects in Course 6

Same name and namespace in other branches
  1. 7.2 includes/Course.inc \Course::getObjects()
  2. 7 includes/Course.inc \Course::getObjects()

Get the course objects in this course.

Return value

array An array of course objects.

2 calls to Course::getObjects()
Course::setActive in includes/course.core.inc
Set the active CourseObject in this Course.
Course::unEnroll in includes/course.core.inc
Un-enroll the user from all course objects and revoke access.

File

includes/course.core.inc, line 549
course.core.inc File for main Course class.

Class

Course
An object that holds CourseObjects and tracker functions?

Code

public function getObjects($flush = FALSE) {
  if (!$this->courseObjects || $flush) {
    $this->courseObjects = array();
    $sql = 'SELECT * FROM {course_outline} co
        WHERE nid = %d
        ORDER BY weight ASC';
    $result = db_query($sql, $this->node->nid);
    while ($row = db_fetch_object($result)) {
      if ($courseObject = course_get_course_object($row, NULL, NULL, $this->user, $this)) {
        $this->courseObjects[] = $courseObject;
      }
    }
  }
  return $this->courseObjects;
}