/** * Data function to insert a database record with the object contents. * * @param $record object If present, uses the contents of it rather than the object. * @return boolean Status of the operation. * @uses $CURMAN global. */ function data_insert_record($record = false) { $status = parent::data_insert_record($record); if (isset($this->track)) { $param['classid'] = $this->id; $param['courseid'] = $this->courseid; foreach ($this->track as $t) { $param['trackid'] = $t; $trackassignobj = new trackassignmentclass($param); $trackassignobj->add(); } } if (!empty($this->moodlecourseid)) { moodle_attach_class($this->id, $this->moodlecourseid); } return $status; }