You are here

public function CourseObject::setCourse in Course 7

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

Set the Course for this CourseObject.

Parameters

Course|int $course: A Course or node ID.

Return value

CourseObject

File

includes/CourseObject.inc, line 759

Class

CourseObject
Parent abstract base class of all course objects.

Code

public function setCourse($course) {
  if (is_numeric($course)) {
    $this
      ->setOption('nid', $course);
  }
  else {
    $this
      ->setOption('nid', $course
      ->getNode()->nid);
  }
  return $this;
}