function Settings::userOverrideEnabled
Same name and namespace in other branches
- main core/themes/admin/src/Settings.php \Drupal\admin\Settings::userOverrideEnabled()
Determine if the user enabled overrides.
Parameters
\Drupal\Core\Session\AccountInterface|null $account: The account object. Current user if NULL.
Return value
bool TRUE, if the user has overridden theme settings, FALSE otherwise.
1 call to Settings::userOverrideEnabled()
- Settings::get in core/
themes/ admin/ src/ Settings.php - Get the setting for the current user.
File
-
core/
themes/ admin/ src/ Settings.php, line 168
Class
- Settings
- Service to handle overridden user settings.
Namespace
Drupal\adminCode
public function userOverrideEnabled(?AccountInterface $account = NULL) : bool {
$overrides =& drupal_static(__CLASS__ . '_' . __METHOD__, []);
if (!$account || !$this->userData) {
$account = $this->currentUser;
}
if (!isset($overrides[$account->id()])) {
$overrides[$account->id()] = $this->allowUserOverrides() && $this->userData
->get('admin', $account->id(), 'enable_user_settings');
}
return $overrides[$account->id()];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.