MDL-68526 core_contentbank: Delete content when a course is deleted

Or when a course category is moved/deleted
This commit is contained in:
Amaia Anabitarte
2020-05-18 16:05:04 +02:00
parent d85118369d
commit f2a9bb6edb
6 changed files with 130 additions and 6 deletions
+12
View File
@@ -134,6 +134,18 @@ abstract class contenttype {
return $content->set_name($name);
}
/**
* Move content to another context.
* This method can be overwritten by the plugins if they need to change some other specific information.
*
* @param content $content The content to rename.
* @param context $context The new context.
* @return boolean true if the content has been renamed; false otherwise.
*/
public function move_content(content $content, \context $context): bool {
return $content->set_contextid($context->id);
}
/**
* Returns the contenttype name of this content.
*