public static function create_user_field_mapping($data) {
        require_capability('moodle/site:config', context_system::instance());
        $userfieldmapping = new user_field_mapping(0, $data);

        // Will throw exceptions on validation failures.
        $userfieldmapping->create();
        return $userfieldmapping;
    }
public static function create_user_field_mapping($data) {
        require_capability('moodle/site:config', context_system::instance());
        $userfieldmapping = new user_field_mapping(0, $data);

        // Will throw exceptions on validation failures.
        $userfieldmapping->create();
        return $userfieldmapping;
    }
public static function create_user_field_mapping ( $ data ) { require_capability ( 'moodle/site:config' , context_system :: instance ( ) ) ; $ userfieldmapping = new user_field_mapping ( 0 , $ data ) ; // Will throw exceptions on validation failures. $ userfieldmapping -> create ( ) ; return $ userfieldmapping ; }
Take the data from the mform and create the user field mapping.

@param stdClass $data
@return \core\oauth2\user_field_mapping
Take the data from the mform and create the user field mapping .