You are here

function course_outline_delete_object in Course 7

Same name and namespace in other branches
  1. 6 course.module \course_outline_delete_object()
  2. 7.2 course.module \course_outline_delete_object()

Delete a course object.

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 2509
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();
}