CourseDelete
in package
Soft-delete a course, or permanently remove one.
delete() only sets lti_context.deleted and deleted_at. It does not remove blob_file rows, lti_message rows, or badge rows.
purge() is the later admin hard delete. Keep it. Child tables with ON DELETE CASCADE go away with the context row. blob_file is ON DELETE SET NULL, so file bytes are removed first. lti_message has no foreign key on link_id, so those rows are deleted first. Minted badges have no foreign key: context_id is set to NULL and the denormalized row stays. Until that purge, badge reads join lti_context and do not filter deleted.
Table of Contents
Methods
- delete() : void
- Hide a course. Sets deleted and deleted_at together.
- purge() : void
- Permanently remove a course, including files and lti_message rows.
- badges() : void
- Keep minted badges. Clear context_id so they no longer point at this course.
- blobs() : void
- messages() : void
- Chat rows point at link_id with no foreign key.
Methods
delete()
Hide a course. Sets deleted and deleted_at together.
public
static delete(int $context_id) : void
Does not delete files, lti_message rows, or badges.
Parameters
- $context_id : int
purge()
Permanently remove a course, including files and lti_message rows.
public
static purge(int $context_id) : void
Settings delete does not call this. A later admin screen will.
Parameters
- $context_id : int
badges()
Keep minted badges. Clear context_id so they no longer point at this course.
private
static badges(int $context_id) : void
The public assertion URL is the badge GUID. Name, email, course title, and badge title are already stored on the row.
Parameters
- $context_id : int
blobs()
private
static blobs(int $context_id) : void
Parameters
- $context_id : int
messages()
Chat rows point at link_id with no foreign key.
private
static messages(int $context_id) : void
Parameters
- $context_id : int