function course_outline_delete_object in Course 7.2
Same name and namespace in other branches
- 6 course.module \course_outline_delete_object()
- 7 course.module \course_outline_delete_object()
Delete a course object.
@todo db_delete() call needs to be replaced with a call to entity fulfillment delete. This call can go away if we react on course object deletion.
Parameters
array $mixed: An array representing a stored course object (containing 'coid').
2 calls to course_outline_delete_object()
- CourseObjectTestCase::testCourseObjectBasicCrud in tests/
CourseObjectTestCase.test - Test basic save/load of CourseObjects.
- course_outline_overview_form_submit in includes/
course.outline.inc - Submit handler.
File
- ./
course.module, line 2534 - course.module Core functionality for Courses.
Code
function course_outline_delete_object($mixed) {
if (is_object($mixed)) {
$mixed = (array) $mixed;
}
// Delete the object.
entity_delete('course_object', $mixed['coid']);
// Delete the object's fulfillments.
db_delete('course_outline_fulfillment')
->condition('coid', $mixed['coid'])
->execute();
}