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


PHP grade_object::insert方法代码示例

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


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

示例1: insert

 /**
  * Records this object in the Database, sets its id to the returned value, and returns that value.
  * If successful this function also fetches the new object data from database and stores it
  * in object properties.
  * @param string $source from where was the object inserted (mod/forum, manual, etc.)
  * @return int PK ID if successful, false otherwise
  */
 function insert($source = null)
 {
     $this->timecreated = time();
     $this->timemodified = time();
     return parent::insert($source);
 }
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:13,代码来源:grade_scale.php

示例2: insert_course_category

 /**
  * Internal function - used only from fetch_course_category()
  * Normal insert() can not be used for course category
  *
  * @param int $courseid The course ID
  * @return int The ID of the new course category
  */
 public function insert_course_category($courseid)
 {
     $this->courseid = $courseid;
     $this->fullname = '?';
     $this->path = null;
     $this->parent = null;
     $this->aggregation = GRADE_AGGREGATE_WEIGHTED_MEAN2;
     $this->apply_default_settings();
     $this->apply_forced_settings();
     $this->timecreated = $this->timemodified = time();
     if (!parent::insert('system')) {
         debugging("Could not insert this category: " . print_r($this, true));
         return false;
     }
     // build path and depth
     $this->update('system');
     return $this->id;
 }
开发者ID:covex-nn,项目名称:moodle,代码行数:25,代码来源:grade_category.php

示例3: insert

 /**
  * Records this object in the Database, sets its id to the returned value, and returns that value.
  * If successful this function also fetches the new object data from database and stores it
  * in object properties.
  * @param string $source from where was the object inserted (mod/forum, manual, etc.)
  * @return int PK ID if successful, false otherwise
  */
 function insert($source = null)
 {
     $this->timecreated = $this->timemodified = time();
     if ($result = parent::insert($source)) {
         if (!empty($this->courseid)) {
             $goc = new object();
             $goc->courseid = $this->courseid;
             $goc->outcomeid = $this->id;
             insert_record('grade_outcomes_courses', $goc);
         }
     }
     return $result;
 }
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:20,代码来源:grade_outcome.php

示例4: insert

 /**
  * In addition to perform parent::insert(), calls force_regrading() method too.
  * @param string $source from where was the object inserted (mod/forum, manual, etc.)
  * @return int PK ID if successful, false otherwise
  */
 function insert($source = null)
 {
     global $CFG;
     if (empty($this->courseid)) {
         error('Can not insert grade item without course id!');
     }
     // load scale if needed
     $this->load_scale();
     // add parent category if needed
     if (empty($this->categoryid) and !$this->is_course_item() and !$this->is_category_item()) {
         $course_category = grade_category::fetch_course_category($this->courseid);
         $this->categoryid = $course_category->id;
     }
     // always place the new items at the end, move them after insert if needed
     $last_sortorder = get_field_select('grade_items', 'MAX(sortorder)', "courseid = {$this->courseid}");
     if (!empty($last_sortorder)) {
         $this->sortorder = $last_sortorder + 1;
     } else {
         $this->sortorder = 1;
     }
     // add proper item numbers to manual items
     if ($this->itemtype == 'manual') {
         if (empty($this->itemnumber)) {
             $this->itemnumber = 0;
         }
     }
     // make sure there is not 0 in outcomeid
     if (empty($this->outcomeid)) {
         $this->outcomeid = null;
     }
     $this->timecreated = $this->timemodified = time();
     if (parent::insert($source)) {
         // force regrading of items if needed
         $this->force_regrading();
         return $this->id;
     } else {
         debugging("Could not insert this grade_item in the database!");
         return false;
     }
 }
开发者ID:r007,项目名称:PMoodle,代码行数:45,代码来源:grade_item.php

示例5: insert

 /**
  * Insert the grade_grade instance into the database.
  *
  * @param string $source From where was the object inserted (mod/forum, manual, etc.)
  * @return int The new grade_grade ID if successful, false otherwise
  */
 public function insert($source = null)
 {
     // TODO: dategraded hack - do not update times, they are used for submission and grading (MDL-31379)
     //$this->timecreated = $this->timemodified = time();
     return parent::insert($source);
 }
开发者ID:sriysk,项目名称:moodle-integration,代码行数:12,代码来源:grade_grade.php

示例6: insert

 /**
  * Records this object in the Database, sets its id to the returned value, and returns that value.
  * If successful this function also fetches the new object data from database and stores it
  * in object properties.
  *
  * @param string $source from where was the object inserted (mod/forum, manual, etc.)
  * @return int PK ID if successful, false otherwise
  */
 public function insert($source = null)
 {
     global $DB;
     $this->timecreated = $this->timemodified = time();
     if ($result = parent::insert($source)) {
         if (!empty($this->courseid)) {
             $goc = new stdClass();
             $goc->courseid = $this->courseid;
             $goc->outcomeid = $this->id;
             $DB->insert_record('grade_outcomes_courses', $goc);
         }
     }
     return $result;
 }
开发者ID:pzhu2004,项目名称:moodle,代码行数:22,代码来源:grade_outcome.php

示例7: debugging

 /**
  * Internal function - used only from fetch_course_category()
  * Normal insert() can not be used for course category
  * @param int $courseid
  * @return bool success
  */
 function insert_course_category($courseid)
 {
     $this->courseid = $courseid;
     $this->fullname = get_string('coursegradecategory', 'grades');
     $this->path = null;
     $this->parent = null;
     $this->aggregate = GRADE_AGGREGATE_MEAN;
     if (!parent::insert('system')) {
         debugging("Could not insert this category: " . print_r($this, true));
         return false;
     }
     // build path and depth
     $this->update('system');
     return $this->id;
 }
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:21,代码来源:grade_category.php


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