You are here

public function Course::getObjects in Course 7.2

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

Get the course objects in this course.

Return value

CourseObject[] An array of course objects.

1 call to Course::getObjects()
Course::setActive in includes/Course.inc
Set the active CourseObject in this Course.

File

includes/Course.inc, line 169

Class

Course
An object that holds CourseObjects and tracker functions?

Code

public function getObjects() {
  if (empty($this->courseObjects)) {
    $efq = new EntityFieldQuery();
    $result = $efq
      ->entityCondition('entity_type', 'course_object')
      ->propertyCondition('nid', $this
      ->getNode()->nid)
      ->propertyOrderBy('weight')
      ->execute();
    if (!empty($result['course_object'])) {
      $this->courseObjects = entity_load('course_object', array_keys($result['course_object']));
    }
  }
  return $this->courseObjects;
}