/** * Prepare the configuration data for the moodle form. * * @return object */ public function prepare_data_for_form() { $data = $this->to_record(); foreach (self::get_config_keys() as $key) { $data->{$key} = $this->get_config($key, configuration::get_step_default_value($key)); } if ($this->get_targettype() !== null) { $this->get_target()->prepare_data_for_form($data); } return $data; }