You are here

public function CourseObjectFulfillment::save in Course 7

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

Track course after saving fulfillment.

Overrides CourseHandler::save

File

includes/CourseObjectFulfillment.inc, line 69

Class

CourseObjectFulfillment
Parent class for course object fulfillment.

Code

public function save() {

  // Make sure the user is enrolled first.
  if (course_enrollment_check($this
    ->getCourseObject()
    ->getCourseNid(), $this->uid)) {
    parent::save();

    // Re-evaluate requirements.
    $account = user_load($this->uid);
    $this
      ->getCourseObject()
      ->getCourse()
      ->track($account);
    return $this;
  }
  else {
    return FALSE;
  }
}