API methods to handle teams and users (#1384)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user