Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Static Public Member Functions | List of all members
backup_plan_dbops Class Reference

Non instantiable helper class providing DB support to the @backup_plan class. More...

Inheritance diagram for backup_plan_dbops:
backup_dbops

Static Public Member Functions

static get_blockids_from_courseid ($courseid)
 Given one course id, return one array with all the block intances that belong to it.
 
static get_blockids_from_moduleid ($moduleid)
 Given one course module id, return one array with all the block intances that belong to it.
 
static get_courseformat_from_courseid ($courseid)
 Given one course id, return its format in DB.
 
static get_default_backup_filename ($format, $type, $id, $users, $anonymised, $useidonly=false, $files=true)
 Returns the default backup filename, based in passed params. More...
 
static get_mnet_localhost_wwwroot ()
 Return the wwwroot of the $CFG->mnet_localhost_id host caching it along the request.
 
static get_modules_from_sectionid ($sectionid)
 Given one section id, return one array with all the course modules that belong to it.
 
static get_sections_from_courseid ($courseid)
 Given one course id, return one array with all the course_sections belonging to it.
 
static get_theme_from_courseid ($courseid)
 Given a course id, returns its theme. More...
 
static require_gradebook_backup ($courseid, $backupid)
 Returns a flag indicating the need to backup gradebook elements like calculated grade items and category visibility If all activity related grade items are being backed up we can also backup calculated grade items and categories.
 

Detailed Description

Non instantiable helper class providing DB support to the @backup_plan class.

This class contains various static methods available for all the DB operations performed by the @backup_plan (and builder) classes

TODO: Finish phpdocs

Member Function Documentation

◆ get_default_backup_filename()

static backup_plan_dbops::get_default_backup_filename (   $format,
  $type,
  $id,
  $users,
  $anonymised,
  $useidonly = false,
  $files = true 
)
static

Returns the default backup filename, based in passed params.

Default format is (see MDL-22145) backup word - format - type - name - date - info . mbz where name is variable (course shortname, section name/id, activity modulename + cmid) and info can be (nu = no user info, an = anonymized). The last param $useidasname, defaulting to false, allows to replace the course shortname by the course id (used by automated backups, to avoid non-ascii chars in OS filesystem)

Parameters
string$formatOne of backup::FORMAT_
string$typeOne of backup::TYPE_
int$courseid,/$sectionid/$cmid
bool$usersShould be true is users were included in the backup
bool$anonymisedShould be true is user information was anonymized.
bool$useidonlyonly use the ID in the file name
Return values
stringThe filename to use

◆ get_theme_from_courseid()

static backup_plan_dbops::get_theme_from_courseid (   $courseid)
static

Given a course id, returns its theme.

This can either be the course theme or (if not specified in course) the category, site theme.

User, session, and inherited-from-mnet themes cannot have backed-up per course data. This is course-related data so it must be in a course theme specified as part of the course structure

Parameters
int$courseid
Return values
stringName of course theme
See also
moodle_page::resolve_theme()

The documentation for this class was generated from the following file: