/**
 * Updates an instance of the virtualclass in the database
 *
 * Given an object containing all the necessary data,
 * (defined by the form in mod_form.php) this function
 * will update an existing instance with new data.
 *
 * @param object $virtualclass An object from the form in mod_form.php
 * @param mod_virtualclass_mod_form $mform
 * @return boolean Success/Fail
 */
function virtualclass_update_instance(stdClass $virtualclass, mod_virtualclass_mod_form $mform = null)
{
    global $DB;
    $virtualclass->timemodified = time();
    $virtualclass->id = $virtualclass->instance;
    $status = $DB->update_record('virtualclass', $virtualclass);
    update_calendar($virtualclass);
    return $status;
}
Example #2
0
/**
 * Updates an instance of the virtualclass in the database
 *
 * Given an object containing all the necessary data,
 * (defined by the form in mod_form.php) this function
 * will update an existing instance with new data.
 *
 * @param object $virtualclass An object from the form in mod_form.php
 * @param mod_virtualclass_mod_form $mform
 * @return boolean Success/Fail
 */
function virtualclass_update_instance(stdClass $virtualclass, mod_virtualclass_mod_form $mform = null) {
    global $DB;
//print_r($virtualclass);exit;
    if(!empty($virtualclass->anyonepresenter)) {
        $virtualclass->moderatorid = 0;
    }
    $virtualclass->timemodified = time();
    $virtualclass->id = $virtualclass->instance;

    $status = $DB->update_record('virtualclass', $virtualclass);
    update_calendar($virtualclass);
    return $status;
}