unify access to custom fields (#3106)

This commit is contained in:
Kevin Papst
2022-01-28 00:04:58 +01:00
committed by GitHub
parent 7a6fab8624
commit 4cb0ac37a6
16 changed files with 132 additions and 9 deletions

View File

@@ -537,7 +537,7 @@ class User implements UserInterface, EquatableInterface, \Serializable
/**
* @param string $name
* @param mixed $default
* @return bool|int|null|string
* @return bool|int|string|null
*/
public function getPreferenceValue(string $name, $default = null)
{
@@ -549,6 +549,15 @@ class User implements UserInterface, EquatableInterface, \Serializable
return $preference->getValue();
}
/**
* @param string $name
* @return bool|int|string|null
*/
public function getMetaFieldValue(string $name)
{
return $this->getPreferenceValue($name);
}
/**
* @param UserPreference $preference
* @return User