You are here

function _course_enrollment_delete in Course 6

Delete an enrollment by eid.

1 string reference to '_course_enrollment_delete'
_course_enrollment_resource in services/course_enrollment_resource.inc
@file course_enrollment_resource.inc Expose course enrollment as as service resource.

File

services/course_enrollment_resource.inc, line 109
course_enrollment_resource.inc Expose course enrollment as as service resource.

Code

function _course_enrollment_delete($eid) {
  if ($enrollment = course_enrolment_load($eid)) {
    $node = node_load($enrollment->nid);
    $user = user_load($enrollment->uid);
    course_unenrol($node, $user);
    return TRUE;
  }
  else {
    services_error('Could not find the enrollment.');
  }
}