API methods to handle teams and users (#1384)

This commit is contained in:
Kevin Papst
2020-01-28 22:28:31 +01:00
committed by GitHub
parent a31e027c54
commit 836a530b86
24 changed files with 1525 additions and 107 deletions

View File

@@ -266,6 +266,27 @@ class User extends BaseUser implements UserInterface
return $this->getPreferenceValue(UserPreference::TIMEZONE, date_default_timezone_get());
}
public function getLanguage(): string
{
return $this->getLocale();
}
public function setLanguage(?string $language)
{
if ($language === null) {
$language = User::DEFAULT_LANGUAGE;
}
$this->setPreferenceValue(UserPreference::LOCALE, $language);
}
public function setTimezone(?string $timezone)
{
if ($timezone === null) {
$timezone = date_default_timezone_get();
}
$this->setPreferenceValue(UserPreference::TIMEZONE, $timezone);
}
/**
* @param string $name
* @param mixed $default