I would like to update the preferred_langcode of a user as soon as he changes the language in a language switcher block.
I'm already aware of the getPreferredLangcode
method mentioned in https://api.drupal.org/api/drupal/core!modules!user!src!Entity!User.php/function/User%3A%3AgetPreferredLangcode/8.6.x and looking for a setPreferredLangcode
method, if one exists.
If not, what other options do I have?