function CourseObjectWebformFulfillment::delete in Course 7.2
Remove all webform submissions associated with this fulfillment.
Overrides CourseObjectNodeFulfillment::delete
File
- modules/
course_webform/ CourseObjectWebformFulfillment.php, line 18
Class
- CourseObjectWebformFulfillment
- Course fulfillment class for webforms.
Code
function delete() {
parent::delete();
$co = $this
->getCourseObject();
$node = $co
->getNode();
if ($sids = $this
->getOption('sids')) {
module_load_include('inc', 'webform', 'includes/webform.submissions');
foreach ($sids as $sid) {
if ($submission = webform_get_submission($node->nid, $sid)) {
webform_submission_delete($node, $submission);
}
}
}
}