当前位置: 首页>>代码示例>>PHP>>正文


PHP backup_nested_element::set_source_table方法代码示例

本文整理汇总了PHP中backup_nested_element::set_source_table方法的典型用法代码示例。如果您正苦于以下问题:PHP backup_nested_element::set_source_table方法的具体用法?PHP backup_nested_element::set_source_table怎么用?PHP backup_nested_element::set_source_table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在backup_nested_element的用法示例。


在下文中一共展示了backup_nested_element::set_source_table方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: define_structure

 protected function define_structure()
 {
     $lockdownbrowser = new backup_nested_element("lockdownbrowser", array("id"), array("course", "name", "intro", "introformat", "timecreated", "timemodified"));
     $settings = new backup_nested_element("settings", array("id"), array("course", "quizid", "attempts", "reviews", "password", "monitor"));
     $lockdownbrowser->add_child($settings);
     $lockdownbrowser->set_source_table("block_lockdownbrowser", array("id" => backup::VAR_BLOCKID));
     $lockdownbrowser->set_source_table("block_lockdownbrowser_sett", array("course" => backup::VAR_COURSEID));
     $settings->annotate_ids("quiz", "quizid");
     return $this->prepare_block_structure($lockdownbrowser);
 }
开发者ID:MoodleMetaData,项目名称:MoodleMetaData,代码行数:10,代码来源:backup_lockdownbrowser_stepslib.php

示例2: define_structure

 protected function define_structure()
 {
     // To know if we are including userinfo
     $userinfo = $this->get_setting_value('userinfo');
     // Define each element separated
     $groupselect = new backup_nested_element('groupselect', array('id'), array('course', 'name', 'intro', 'introformat', 'targetgrouping', 'signuptype', 'password', 'maxmembers', 'individual_limits', 'timeavailable', 'timedue', 'timecreated', 'timemodified'));
     $limits = new backup_nested_element('limits');
     $limit = new backup_nested_element('limit', array('id'), array('groupselect', 'groupid', 'lim'));
     // Build the tree
     $groupselect->add_child($limits);
     $limits->add_child($limit);
     // Define sources
     $groupselect->set_source_table('groupselect', array('id' => backup::VAR_ACTIVITYID));
     $limit->set_source_sql('
         SELECT *
           FROM {groupselect_limits}
           WHERE groupselect = ?', array(backup::VAR_PARENTID));
     // Define id annotations
     $groupselect->annotate_ids('grouping', 'targetgrouping');
     $limit->annotate_ids('group', 'groupid');
     // Define file annotations
     $groupselect->annotate_files('mod_groupselect', 'intro', null);
     // This file area hasn't itemid
     // Return the root element (groupselect), wrapped into standard activity structure
     return $this->prepare_activity_structure($groupselect);
 }
开发者ID:NigelCunningham,项目名称:moodle-mod_groupselect,代码行数:26,代码来源:backup_groupselect_stepslib.php

示例3: define_structure

 /**
  * Define the structure for the publication activity
  * @return void
  */
 protected function define_structure()
 {
     // To know if we are including userinfo.
     $userinfo = $this->get_setting_value('userinfo');
     // Define each element separated.
     $publication = new backup_nested_element('publication', array('id'), array('name', 'intro', 'introformat', 'alwaysshowdescription', 'duedate', 'allowsubmissionsfromdate', 'timemodified', 'cutoffdate', 'mode', 'importfrom', 'obtainstudentapproval', 'maxfiles', 'maxbytes', 'allowedfiletypes', 'obtainteacherapproval'));
     $extduedates = new backup_nested_element('extduedates');
     $extduedate = new backup_nested_element('extduedate', array('id'), array('userid', 'publication', 'extensionduedate'));
     $files = new backup_nested_element('files');
     $file = new backup_nested_element('file', array('id'), array('userid', 'timecreated', 'fileid', 'filename', 'contenthash', 'type', 'teacherapproval', 'studentapproval'));
     // Define sources.
     $publication->set_source_table('publication', array('id' => backup::VAR_ACTIVITYID));
     if ($userinfo) {
         // Build the tree.
         $publication->add_child($extduedates);
         $extduedates->add_child($extduedate);
         $publication->add_child($files);
         $files->add_child($file);
         $extduedate->set_source_table('publication_extduedates', array('publication' => backup::VAR_PARENTID));
         $file->set_source_table('publication_file', array('publication' => backup::VAR_PARENTID));
         $file->annotate_files('mod_publication', 'attachment', null);
         // Define id annotations.
         $extduedate->annotate_ids('user', 'userid');
         $file->annotate_ids('user', 'userid');
         // Define file annotations.
         // This file area hasn't itemid.
         $publication->annotate_files('mod_publication', 'attachment', null);
     }
     // Return the root element (publication), wrapped into standard activity structure.
     return $this->prepare_activity_structure($publication);
 }
开发者ID:Kathrin84,项目名称:moodle-mod_publication,代码行数:35,代码来源:backup_publication_stepslib.php

示例4: define_structure

 /**
  * Define the structure for the assign activity
  * @return void
  */
 protected function define_structure()
 {
     // To know if we are including userinfo.
     $userinfo = $this->get_setting_value('userinfo');
     // Define each element separated.
     $blended = new backup_nested_element('blended', array('id'), array('name', 'intro', 'introformat', 'idmethod', 'idtype', 'codebartype', 'lengthuserinfo', 'teammethod', 'numteams', 'nummembers', 'assignment', 'randomkey'));
     $teams = new backup_nested_element('teams');
     $team = new backup_nested_element('team', array('id'), array('id_team', 'itemid', 'name_team', 'userid_leader'));
     $members = new backup_nested_element('members');
     $member = new backup_nested_element('member', array('id'), array('userid', 'id_member', 'id_team', 'leader'));
     //Build the tree
     $blended->add_child($teams);
     $teams->add_child($team);
     $team->add_child($members);
     $members->add_child($member);
     // Define sources
     $blended->set_source_table('blended', array('id' => backup::VAR_ACTIVITYID));
     //TODO remove blended_member estructure
     $member->set_source_table('blended_member', array('id_team' => backup::VAR_PARENTID));
     //$team->set_source_table('blended_team', array('blendedid' => backup::VAR_PARENTID));
     //$assign_grouping->set_source_table('blended_assign_grouping', array('blendedid' => backup::VAR_PARENTID));
     //$member->set_source_table('blended_member', array('blendedid' => backup::VAR_PARENTID));
     //$grade->set_source_table('blended_grade', array('blendedid' => backup::VAR_PARENTID));
     //Anotate ids
     $team->annotate_ids('group', 'id_team');
     $team->annotate_ids('user', 'userid_leader');
     $member->annotate_ids('user', 'userid');
     $member->annotate_ids('group', 'id_team');
     // This file area hasn't itemid.
     $blended->annotate_files('mod_blended', 'intro', null);
     // Return the root element (blended), wrapped into standard activity structure.
     return $this->prepare_activity_structure($blended);
 }
开发者ID:juacas,项目名称:moodle-mod_blended,代码行数:37,代码来源:backup_blended_stepslib.php

示例5: define_structure

 protected function define_structure()
 {
     $userinfo = $this->get_setting_value('userinfo');
     // Define each element separated.
     $chat = new backup_nested_element('chat', array('id'), array('name', 'intro', 'introformat', 'keepdays', 'studentlogs', 'chattime', 'schedule', 'timemodified'));
     $messages = new backup_nested_element('messages');
     $message = new backup_nested_element('message', array('id'), array('userid', 'groupid', 'system', 'message_text', 'timestamp'));
     // It is not cool to have two tags with same name, so we need to rename message field to message_text.
     $message->set_source_alias('message', 'message_text');
     // Build the tree.
     $chat->add_child($messages);
     $messages->add_child($message);
     // Define sources.
     $chat->set_source_table('chat', array('id' => backup::VAR_ACTIVITYID));
     // User related messages only happen if we are including user info.
     if ($userinfo) {
         $message->set_source_table('chat_messages', array('chatid' => backup::VAR_PARENTID));
     }
     // Define id annotations.
     $message->annotate_ids('user', 'userid');
     $message->annotate_ids('group', 'groupid');
     // Annotate the file areas in chat module.
     $chat->annotate_files('mod_chat', 'intro', null);
     // The chat_intro area doesn't use itemid.
     // Return the root element (chat), wrapped into standard activity structure.
     return $this->prepare_activity_structure($chat);
 }
开发者ID:evltuma,项目名称:moodle,代码行数:27,代码来源:backup_chat_stepslib.php

示例6: define_structure

 protected function define_structure()
 {
     // Define each element separated
     $dialogue = new backup_nested_element('dialogue', array('id'), array('course', 'deleteafter', 'dialoguetype', 'multipleconversations', 'maildefault', 'timemodified', 'name', 'intro', 'edittime'));
     $conversations = new backup_nested_element('conversations');
     $conversation = new backup_nested_element('conversation', array('id'), array('dialogueid', 'userid', 'recipientid', 'lastid', 'lastrecipientid', 'timemodified', 'closed', 'seenon', 'ctype', 'format', 'subject', 'groupid', 'grouping'));
     $entries = new backup_nested_element('entries');
     $entry = new backup_nested_element('entry', array('id'), array('dialogueid', 'conversationid', 'userid', 'recipientid', 'timecreated', 'timemodified', 'mailed', 'text', 'attachment'));
     $readentries = new backup_nested_element('read_entries');
     $read = new backup_nested_element('read_entry', array('id'), array('entryid', 'userid', 'firstread', 'lastread', 'conversationid'));
     // Build the tree
     $dialogue->add_child($conversations);
     $conversations->add_child($conversation);
     $conversation->add_child($entries);
     $entries->add_child($entry);
     $conversation->add_child($readentries);
     $readentries->add_child($read);
     // Define sources
     $dialogue->set_source_table('dialogue', array('id' => backup::VAR_ACTIVITYID));
     $conversation->set_source_table('dialogue_conversations', array('dialogueid' => backup::VAR_PARENTID));
     $entry->set_source_table('dialogue_entries', array('conversationid' => backup::VAR_PARENTID));
     $read->set_source_table('dialogue_read', array('conversationid' => backup::VAR_PARENTID));
     // Define id annotations
     $conversation->annotate_ids('user', 'userid');
     $conversation->annotate_ids('user', 'recipientid');
     $entry->annotate_ids('user', 'userid');
     $entry->annotate_ids('user', 'recipientid');
     $read->annotate_ids('user', 'userid');
     // Define file annotations
     $dialogue->annotate_files('mod_dialogue', 'intro', null);
     // This file area hasn't itemid
     $entry->annotate_files('mod_dialogue', 'attachment', 'id');
     // Return the root element, wrapped into standard activity structure
     return $this->prepare_activity_structure($dialogue);
 }
开发者ID:netspotau,项目名称:moodle-mod_dialogue,代码行数:35,代码来源:backup_dialogue_stepslib.php

示例7: define_structure

 protected function define_structure()
 {
     global $CFG;
     // To know if we are including userinfo
     $userinfo = $this->get_setting_value('userinfo');
     // Define each element separated
     $certificate = new backup_nested_element('simplecertificate', array('id'), array('name', 'intro', 'introformat', 'timemodified', 'width', 'height', 'certificateimage', 'certificatetext', 'certificatetextformat', 'certificatetextx', 'certificatetexty', 'coursename', 'coursehours', 'outcome', 'certdate', 'certdatefmt', 'certgrade', 'gradefmt', 'emailfrom', 'emailothers', 'emailteachers', 'reportcert', 'delivery', 'requiredtime', 'printqrcode', 'qrcodefirstpage', 'codex', 'codey', 'enablesecondpage', 'secondpagex', 'secondpagey', 'secondpagetext', 'secondpagetextformat', 'secondimage', 'timestartdatefmt'));
     $issues = new backup_nested_element('issues');
     $issue = new backup_nested_element('issue', array('id'), array('userid', 'certificatename', 'timecreated', 'code', 'timedeleted'));
     // Build the tree
     $certificate->add_child($issues);
     $issues->add_child($issue);
     // Define sources
     $certificate->set_source_table('simplecertificate', array('id' => backup::VAR_ACTIVITYID));
     // All the rest of elements only happen if we are including user info
     if ($userinfo) {
         $issue->set_source_table('simplecertificate_issues', array('certificateid' => backup::VAR_PARENTID));
     }
     // Annotate the user id's where required.
     $certificate->annotate_ids('outcome', 'outcome');
     $certificate->annotate_ids('certdate', 'certdate');
     $certificate->annotate_ids('certgrade', 'certgrade');
     $issue->annotate_ids('user', 'userid');
     // Define file annotations
     //$certificate->annotate_files('mod_simplecertificate', 'intro', null);
     $certificate->annotate_files(simplecertificate::CERTIFICATE_COMPONENT_NAME, simplecertificate::CERTIFICATE_IMAGE_FILE_AREA, null);
     $issue->annotate_files(simplecertificate::CERTIFICATE_COMPONENT_NAME, simplecertificate::CERTIFICATE_ISSUES_FILE_AREA, 'id');
     // Return the root element (certificate), wrapped into standard activity structure
     return $this->prepare_activity_structure($certificate);
 }
开发者ID:v--k,项目名称:moodle-mod_simplecertificate,代码行数:30,代码来源:backup_simplecertificate_stepslib.php

示例8: define_structure

 protected function define_structure()
 {
     $equella = new backup_nested_element('equella', array('id'), array('course', 'name', 'intro', 'introformat', 'timecreated', 'timemodified', 'url', 'mimetype', 'popup', 'activation', 'uuid', 'version', 'path', 'attachmentuuid', 'ltisalt'));
     $equella->set_source_table('equella', array('id' => backup::VAR_ACTIVITYID));
     $equella->annotate_files('mod_equella', 'intro', null);
     return $this->prepare_activity_structure($equella);
 }
开发者ID:CTANZ,项目名称:moodle-mod_equella,代码行数:7,代码来源:backup_equella_stepslib.php

示例9: define_structure

 protected function define_structure()
 {
     // To know if we are including userinfo
     $userinfo = $this->get_setting_value('userinfo');
     // Define each element separated
     $voiceshadow = new backup_nested_element('voiceshadow', array('id'), array('course', 'name', 'intro', 'introformat', 'timeopen', 'timeclose', 'teacher', 'embedvideo', 'recordtype', 'timemodified'));
     $files = new backup_nested_element('files', array('id'), array('instance', 'userid', 'summary', 'itemoldid', 'itemid', 'itemimgid', 'filename', 'time'));
     $ratings = new backup_nested_element('ratings', array('id'), array('fileid', 'userid', 'rating', 'ratingrhythm', 'ratingclear', 'ratingintonation', 'ratingspeed', 'ratingreproduction', 'summary', 'time'));
     $comments = new backup_nested_element('comments', array('id'), array('instance', 'fileid', 'userid', 'summary', 'itemoldid', 'itemid', 'itemimgid', 'filename', 'time'));
     $process = new backup_nested_element('process', array('id'), array('itemid', 'type'));
     // Build the tree
     $voiceshadow->add_child($files);
     $voiceshadow->add_child($ratings);
     $voiceshadow->add_child($comments);
     $voiceshadow->add_child($process);
     // Define sources
     $voiceshadow->set_source_table('voiceshadow', array('id' => backup::VAR_ACTIVITYID, 'course' => backup::VAR_COURSEID));
     $files->set_source_table('voiceshadow_files', array('instance' => backup::VAR_ACTIVITYID));
     $comments->set_source_table('voiceshadow_comments', array('instance' => backup::VAR_ACTIVITYID));
     // Define id annotations
     $voiceshadow->annotate_ids('teacher', 'userid');
     $files->annotate_ids('userid', 'userid');
     $ratings->annotate_ids('userid', 'userid');
     $comments->annotate_ids('userid', 'userid');
     // Return the root element (voiceshadow), wrapped into standard activity structure
     return $this->prepare_activity_structure($voiceshadow);
 }
开发者ID:e-rasvet,项目名称:voiceshadow,代码行数:27,代码来源:backup_voiceshadow_stepslib.php

示例10: define_structure

 protected function define_structure()
 {
     // To know if we are including userinfo
     $userinfo = $this->get_setting_value('userinfo');
     // Define each element separated
     $geogebra = new backup_nested_element('geogebra', array('id'), array('name', 'intro', 'introformat', 'url', 'attributes', 'width', 'height', 'showsubmit', 'grade', 'autograde', 'maxattempts', 'grademethod', 'timeavailable', 'timedue', 'timecreated', 'timemodified'));
     $attempts = new backup_nested_element('attempts');
     $attempt = new backup_nested_element('attempt', array('id'), array('geogebra', 'userid', 'vars', 'gradecomment', 'finished', 'dateteacher', 'datestudent'));
     // Build the tree
     $geogebra->add_child($attempts);
     $attempts->add_child($attempt);
     // Define sources
     $geogebra->set_source_table('geogebra', array('id' => backup::VAR_ACTIVITYID));
     // All the rest of elements only happen if we are including user info
     if ($userinfo) {
         $attempt->set_source_table('geogebra_attempts', array('geogebra' => backup::VAR_PARENTID));
     }
     // Define id annotations
     $geogebra->annotate_ids('scale', 'grade');
     $attempt->annotate_ids('user', 'userid');
     // Define file annotations
     $geogebra->annotate_files('mod_geogebra', 'intro', null);
     // This file area hasn't itemid
     $geogebra->annotate_files('mod_geogebra', 'content', null);
     // This file area hasn't itemid
     // Return the root element (geogebra), wrapped into standard activity structure
     return $this->prepare_activity_structure($geogebra);
 }
开发者ID:ninelanterns,项目名称:moodle-mod_geogebra,代码行数:28,代码来源:backup_geogebra_stepslib.php

示例11: define_structure

 protected function define_structure()
 {
     // To know if we are including userinfo
     $userinfo = $this->get_setting_value('userinfo');
     // Define each element separated
     $hvp = new backup_nested_element('hvp', array('id'), array('course', 'name', 'json_content', 'embed_type', 'disable', 'main_library_id', 'content_type', 'author', 'license', 'meta_keywords', 'meta_description', 'filtered', 'slug', 'timecreated', 'timemodified'));
     $hvp_libraries = new backup_nested_element('libraries');
     $hvp_library = new backup_nested_element('library', null, array('machine_name', 'major_version', 'minor_version', 'patch_version', 'dependency_type', 'drop_css', 'weight'));
     $content_user_data_entries = new backup_nested_element('content_user_data');
     $content_user_data = new backup_nested_element('entry', array('id'), array('user_id', 'hvp_id', 'sub_content_id', 'data_id', 'data', 'preloaded', 'delete_on_content_change'));
     // Build the tree
     $hvp->add_child($content_user_data_entries);
     $content_user_data_entries->add_child($content_user_data);
     $hvp->add_child($hvp_libraries);
     $hvp_libraries->add_child($hvp_library);
     // Define sources
     $hvp->set_source_table('hvp', array('id' => backup::VAR_ACTIVITYID));
     $lib_sql = "SELECT\n                machine_name,\n                major_version,\n                minor_version,\n                patch_version,\n                dependency_type,\n                drop_css,\n                weight\n            FROM {hvp_libraries} hl\n            JOIN {hvp_contents_libraries} hcl\n                ON hl.id = hcl.library_id\n            JOIN {hvp} h\n                ON h.id = hcl.hvp_id\n            WHERE h.id = ?";
     $hvp_library->set_source_sql($lib_sql, array(backup::VAR_ACTIVITYID));
     // All the rest of elements only happen if we are including user info
     if ($userinfo) {
         $content_user_data->set_source_table('hvp_content_user_data', array('hvp_id' => backup::VAR_PARENTID), 'id ASC');
     }
     // Define id annotations
     $content_user_data->annotate_ids('user', 'user_id');
     // Define file annotations
     $hvp->annotate_files('mod_hvp', 'content', null);
     // Return the root element (hvp), wrapped into standard activity structure
     return $this->prepare_activity_structure($hvp);
 }
开发者ID:nadavkav,项目名称:h5p-moodle-plugin,代码行数:30,代码来源:backup_hvp_stepslib.php

示例12: define_structure

 protected function define_structure()
 {
     // To know if we are including userinfo
     $userinfo = $this->get_setting_value('userinfo');
     // Define each element separated
     $groupselect = new backup_nested_element('groupselect', array('id'), array('name', 'intro', 'introformat', 'targetgrouping', 'maxmembers', 'timeavailable', 'timedue', 'timecreated', 'timemodified', 'hidefullgroups', 'deleteemptygroups', 'studentcancreate', 'minmembers', 'assignteachers', 'studentcansetdesc', 'showassignedteacher', 'studentcansetenrolmentkey', 'studentcansetgroupname', 'notifyexpiredselection'));
     $passwords = new backup_nested_element('passwords');
     $password = new backup_nested_element('password', array('id'), array('groupid', 'password'));
     $groupteachers = new backup_nested_element('groupteachers');
     $groupteacher = new backup_nested_element('groupteacher', array('id'), array('groupid', 'teacherid'));
     // Build the tree
     $groupselect->add_child($passwords);
     $passwords->add_child($password);
     $groupselect->add_child($groupteachers);
     $groupteachers->add_child($groupteacher);
     // Define sources
     $groupselect->set_source_table('groupselect', array('id' => backup::VAR_ACTIVITYID));
     $password->set_source_table('groupselect_passwords', array('instance_id' => backup::VAR_ACTIVITYID));
     if ($userinfo) {
         $groupteacher->set_source_table('groupselect_groups_teachers', array('instance_id' => backup::VAR_ACTIVITYID));
     }
     // Define id annotations
     $groupselect->annotate_ids('grouping', 'targetgrouping');
     $password->annotate_ids('group', 'groupid');
     $groupteacher->annotate_ids('group', 'groupid');
     $groupteacher->annotate_ids('user', 'teacherid');
     // Define file annotations
     $groupselect->annotate_files('mod_groupselect', 'intro', null);
     // This file areas haven't itemid
     // Return the root element (groupselect), wrapped into standard activity structure
     return $this->prepare_activity_structure($groupselect);
 }
开发者ID:BLC-HTWChur,项目名称:moodle-mod_groupselect,代码行数:32,代码来源:backup_groupselect_stepslib.php

示例13: define_structure

 protected function define_structure()
 {
     // To know if we are including userinfo.
     $userinfo = $this->get_setting_value('userinfo');
     // Define each element separated.
     $teambuilder = new backup_nested_element('teambuilder', array('id'), array('course', 'name', 'intro', 'introformat', 'open', 'close', 'groupid', 'allowupdate'));
     $questions = new backup_nested_element('questions');
     $question = new backup_nested_element('question', array('id'), array('builder', 'question', 'type', 'display', 'ordinal'));
     $answers = new backup_nested_element('answers');
     $answer = new backup_nested_element('answer', array('id'), array('question', 'answer', 'ordinal'));
     $responses = new backup_nested_element('responses');
     $response = new backup_nested_element('response', array('id'), array('userid', 'answerid'));
     // Build the tree.
     $teambuilder->add_child($questions);
     $questions->add_child($question);
     $question->add_child($answers);
     $answers->add_child($answer);
     $answer->add_child($responses);
     $responses->add_child($response);
     // Define sources.
     $teambuilder->set_source_table('teambuilder', array('id' => backup::VAR_ACTIVITYID));
     $question->set_source_table('teambuilder_question', array('builder' => backup::VAR_PARENTID));
     $answer->set_source_table('teambuilder_answer', array('question' => backup::VAR_PARENTID));
     // All the rest of elements only happen if we are including user info.
     if ($userinfo) {
         $response->set_source_table('teambuilder_response', array('answerid' => backup::VAR_PARENTID));
     }
     $teambuilder->annotate_ids('group', 'groupid');
     $response->annotate_ids('user', 'userid');
     // Define file annotations.
     $teambuilder->annotate_files('mod_teambuilder', 'intro', null);
     // Return the root element (teambuilder), wrapped into standard activity structure.
     return $this->prepare_activity_structure($teambuilder);
 }
开发者ID:netspotau,项目名称:moodle-mod_teambuilder,代码行数:34,代码来源:backup_teambuilder_stepslib.php

示例14: define_structure

 protected function define_structure()
 {
     // To know if we are including userinfo
     $userinfo = $this->get_setting_value('userinfo');
     // Define each element separated
     $jclic = new backup_nested_element('jclic', array('id'), array('name', 'intro', 'introformat', 'url', 'skin', 'maxattempts', 'width', 'height', 'avaluation', 'maxgrade', 'grade', 'lang', 'exiturl', 'timeavailable', 'timedue'));
     $sessions = new backup_nested_element('sessions');
     $session = new backup_nested_element('session', array('id'), array('session_id', 'user_id', 'session_datetime', 'project_name', 'session_key', 'session_code', 'session_context'));
     $activities = new backup_nested_element('sessionactivities');
     $activity = new backup_nested_element('sessionactivity', array('id'), array('session_id', 'activity_id', 'activity_name', 'num_actions', 'score', 'activity_solved', 'qualification', 'total_time', 'activity_code'));
     // Build the tree
     $jclic->add_child($sessions);
     $sessions->add_child($session);
     $session->add_child($activities);
     $activities->add_child($activity);
     // Define sources
     $jclic->set_source_table('jclic', array('id' => backup::VAR_ACTIVITYID));
     // All the rest of elements only happen if we are including user info
     if ($userinfo) {
         $session->set_source_table('jclic_sessions', array('jclicid' => backup::VAR_PARENTID));
         $activity->set_source_table('jclic_activities', array('session_id' => '../../session_id'));
     }
     // Define id annotations
     $jclic->annotate_ids('scale', 'grade');
     $session->annotate_ids('user', 'user_id');
     // Define file annotations
     $jclic->annotate_files('mod_jclic', 'intro', null);
     // This file area hasn't itemid
     $jclic->annotate_files('mod_jclic', 'content', null);
     // This file area hasn't itemid
     // Return the root element (jclic), wrapped into standard activity structure
     return $this->prepare_activity_structure($jclic);
 }
开发者ID:danielvdml,项目名称:moodleyarcho,代码行数:33,代码来源:backup_jclic_stepslib.php

示例15: define_structure

 protected function define_structure()
 {
     // To know if we are including userinfo
     $userinfo = $this->get_setting_value('userinfo');
     // Define each element separated
     $scheduler = new backup_nested_element('scheduler', array('id'), array('name', 'intro', 'introformat', 'schedulermode', 'maxbookings', 'guardtime', 'defaultslotduration', 'allownotifications', 'staffrolename', 'scale', 'gradingstrategy', 'bookingrouping', 'timemodified'));
     $slots = new backup_nested_element('slots');
     $slot = new backup_nested_element('slot', array('id'), array('starttime', 'duration', 'teacherid', 'appointmentlocation', 'timemodified', 'notes', 'exclusivity', 'appointmentnote', 'emaildate', 'hideuntil'));
     $appointments = new backup_nested_element('appointments');
     $appointment = new backup_nested_element('appointment', array('id'), array('studentid', 'attended', 'grade', 'appointmentnote', 'timecreated', 'timemodified'));
     // Build the tree
     $scheduler->add_child($slots);
     $slots->add_child($slot);
     $slot->add_child($appointments);
     $appointments->add_child($appointment);
     // Define sources
     $scheduler->set_source_table('scheduler', array('id' => backup::VAR_ACTIVITYID));
     $scheduler->annotate_ids('grouping', 'bookingrouping');
     // Include appointments only if we back up user information
     if ($userinfo) {
         $slot->set_source_table('scheduler_slots', array('schedulerid' => backup::VAR_PARENTID));
         $appointment->set_source_table('scheduler_appointment', array('slotid' => backup::VAR_PARENTID));
     }
     // Define id annotations
     $scheduler->annotate_ids('scale', 'scale');
     if ($userinfo) {
         $slot->annotate_ids('user', 'teacherid');
         $appointment->annotate_ids('user', 'studentid');
     }
     // Define file annotations
     $scheduler->annotate_files('mod_scheduler', 'intro', null);
     // This file area has no itemid
     // Return the root element (scheduler), wrapped into standard activity structure
     return $this->prepare_activity_structure($scheduler);
 }
开发者ID:ninelanterns,项目名称:moodle-mod_scheduler,代码行数:35,代码来源:backup_scheduler_stepslib.php


注:本文中的backup_nested_element::set_source_table方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。