/** * Deletes an referentiel instance * * This is done by calling the delete_instance() method of the referentiel type class * Given an ID of an instance of this module, * this function will permanently delete any activity and certificate and task ank accompagnement * that depends on it. * * @param int $id Id of the module instance * @param boolean $purge : if true module instance is deleted too * @return boolean Success/Failure */ function referentiel_delete_instance($id, $purge = true) { global $CFG, $DB; if (!($referentiel = $DB->get_record('referentiel', array('id' => $id)))) { return false; } $ref = new referentiel(); return $ref->delete_instance($referentiel, $purge); }