/** * Prepare the configuration data for the moodle form. * * @return object */ public function prepare_data_for_form() { $data = $this->to_record(); foreach (configuration::get_defaultable_keys() as $key) { $data->{$key} = $this->get_config($key, configuration::get_default_value($key)); } return $data; }