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


PHP backup_nested_element::fill_values方法代码示例

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


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

示例1: define_structure

 protected function define_structure()
 {
     global $CFG, $DB;
     // To know if we are including userinfo
     $userinfo = $this->get_setting_value('userinfo');
     // Define each element separated
     $turnitintool = new backup_nested_element('turnitintool', array('id'), array('type', 'name', 'grade', 'numparts', 'tiiaccount', 'defaultdtstart', 'defaultdtdue', 'defaultdtpost', 'anon', 'portfolio', 'allowlate', 'reportgenspeed', 'submitpapersto', 'spapercheck', 'internetcheck', 'journalcheck', 'maxfilesize', 'intro', 'introformat', 'timecreated', 'timemodified', 'studentreports', 'dateformat', 'usegrademark', 'gradedisplay', 'autoupdates', 'commentedittime', 'commentmaxsize', 'autosubmission', 'shownonsubmission', 'excludebiblio', 'excludequoted', 'excludevalue', 'excludetype', 'erater', 'erater_handbook', 'erater_dictionary', 'erater_spelling', 'erater_grammar', 'erater_usage', 'erater_mechanics', 'erater_style', 'transmatch'));
     $parts = new backup_nested_element('parts');
     $part = new backup_nested_element('part', array('id'), array('turnitintoolid', 'partname', 'tiiassignid', 'dtstart', 'dtdue', 'dtpost', 'maxmarks', 'deleted'));
     $courses = new backup_nested_element('courses');
     $course = new backup_nested_element('course', array('id'), array('courseid', 'ownerid', 'ownertiiuid', 'owneremail', 'ownerfn', 'ownerln', 'ownerun', 'turnitin_ctl', 'turnitin_cid'));
     $submissions = new backup_nested_element('submissions');
     $submission = new backup_nested_element('submission', array('id'), array('userid', 'submission_part', 'submission_title', 'submission_type', 'submission_filename', 'submission_objectid', 'submission_score', 'submission_grade', 'submission_gmimaged', 'submission_status', 'submission_queued', 'submission_attempts', 'submission_modified', 'submission_parent', 'submission_nmuserid', 'submission_nmfirstname', 'submission_nmlastname', 'submission_unanon', 'submission_anonreason', 'submission_transmatch', 'tiiuserid'));
     $comments = new backup_nested_element('comments');
     $comment = new backup_nested_element('comment', array('id'), array('submissionid', 'userid', 'commenttext', 'dateupdated', 'deleted'));
     // Build the tree
     $comments->add_child($comment);
     $submission->add_child($comments);
     $submissions->add_child($submission);
     $parts->add_child($part);
     $turnitintool->add_child($parts);
     $turnitintool->add_child($course);
     $turnitintool->add_child($submissions);
     // Define sources
     $turnitintool->set_source_table('turnitintool', array('id' => backup::VAR_ACTIVITYID));
     $values['tiiaccount'] = $CFG->turnitin_account_id;
     $turnitintool->fill_values($values);
     $part->set_source_table('turnitintool_parts', array('turnitintoolid' => backup::VAR_ACTIVITYID));
     $course->set_source_sql('
         SELECT  t.id, t.courseid, t.ownerid, tu.turnitin_uid AS ownertiiuid,
                 u.email AS owneremail, u.firstname AS ownerfn, u.lastname AS ownerln,
                 u.username AS ownerun, t.turnitin_ctl, t.turnitin_cid
           FROM {turnitintool_courses} t, {user} u, {turnitintool_users} tu
          WHERE t.ownerid=u.id AND tu.userid=t.ownerid AND t.courseid = ?', array(backup::VAR_COURSEID));
     // All the rest of elements only happen if we are including user info
     if ($userinfo) {
         $comment->set_source_table('turnitintool_comments', array('submissionid' => '../../id'));
         //$submission->set_source_table('turnitintool_submissions', array('turnitintoolid' => '../../id'));
         $submission->set_source_sql('
         SELECT  s.*, tu.turnitin_uid AS tiiuserid
           FROM {turnitintool_submissions} s, {turnitintool_users} tu
          WHERE s.userid=tu.userid AND s.turnitintoolid = ?', array(backup::VAR_ACTIVITYID));
     }
     // Define id annotations
     $submission->annotate_ids('user', 'userid');
     // Define file annotations
     $turnitintool->annotate_files('mod_turnitintool', 'intro', null);
     // This file area hasn't itemid
     $submission->annotate_files('mod_turnitintool', 'submission', 'id');
     // Return the root element (turnitintool), wrapped into standard activity structure
     return $this->prepare_activity_structure($turnitintool);
 }
开发者ID:ccle,项目名称:moodle-mod_turnitintool,代码行数:52,代码来源:backup_turnitintool_stepslib.php

示例2: fill_values

 public function fill_values($values)
 {
     // Fill values
     parent::fill_values($values);
     // Do our own tasks (copy file from moodle to backup)
     try {
         backup_file_manager::copy_file_moodle2backup($this->backupid, $values);
     } catch (file_exception $e) {
         $this->add_result(array('missing_files_in_pool' => true));
         // Build helpful log message with all information necessary to identify
         // file location.
         $context = context::instance_by_id($values->contextid, IGNORE_MISSING);
         $contextname = '';
         if ($context) {
             $contextname = ' \'' . $context->get_context_name() . '\'';
         }
         $message = 'Missing file in pool: ' . $values->filepath . $values->filename . ' (context ' . $values->contextid . $contextname . ', component ' . $values->component . ', filearea ' . $values->filearea . ', itemid ' . $values->itemid . ') [' . $e->debuginfo . ']';
         $this->add_log($message, backup::LOG_WARNING);
     }
 }
开发者ID:bobpuffer,项目名称:moodleUCLA-LUTH,代码行数:20,代码来源:backup_custom_fields.php

示例3: fill_values

 public function fill_values($values)
 {
     // Fill values
     parent::fill_values($values);
     // Do our own tasks (copy file from moodle to backup)
     backup_file_manager::copy_file_moodle2backup($this->backupid, $values);
 }
开发者ID:nmicha,项目名称:moodle,代码行数:7,代码来源:backup_custom_fields.php

示例4: fill_values

 public function fill_values($values)
 {
     // Fill values
     parent::fill_values($values);
     // Do our own tasks (copy file from moodle to backup)
     try {
         backup_file_manager::copy_file_moodle2backup($this->backupid, $values);
     } catch (file_exception $e) {
         $this->add_result(array('missing_files_in_pool' => true));
         $this->add_log('missing file in pool: ' . $e->debuginfo, backup::LOG_WARNING);
     }
 }
开发者ID:JP-Git,项目名称:moodle,代码行数:12,代码来源:backup_custom_fields.php


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