MDL-68526 core_contentbank: Delete content when a course is deleted
Or when a course category is moved/deleted
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user