You are here

function CourseObject::getCourse in Course 7

Same name and namespace in other branches
  1. 6 includes/course_object.core.inc \CourseObject::getCourse()
  2. 7.2 includes/CourseObject.inc \CourseObject::getCourse()

Get the Course that contains this CourseObject.

Return value

Course

2 calls to CourseObject::getCourse()
CourseObject::access in includes/CourseObject.inc
Access functionality for course objects.
CourseObject::optionsSubmit in includes/CourseObject.inc
Save object configs to cache.

File

includes/CourseObject.inc, line 774

Class

CourseObject
Parent abstract base class of all course objects.

Code

function getCourse() {
  $course = entity_load_single('course', $this->nid);

  /** @deprecated */
  if (!empty($this->user)) {
    $account = $this->user;
  }
  else {
    global $user;
    $account = $user;
  }
  $course
    ->setUser($account);
  return $course;
}