/** * Converts add button data to data for our add form * * @return stdClass Form data, or null if none */ function get_default_object_for_add() { $obj = (object) pmclass::get_default(); $parent = $this->optional_param('parent', 0, PARAM_INT); if ($parent) { $obj->courseid = $parent; } return $obj; }