AccountProxy::setAccount

public AccountProxy::setAccount(AccountInterface $account) Sets the currently wrapped account. Setting the current account is highly discouraged! Instead, make sure to inject the desired user object into the dependent code directly. A preferable method of account impersonation is to use \Drupal\Core\Session\AccountSwitcherInterface::switchTo() and \Drupal\Core\Session\AccountSwitcherInterface::switchBack(). Parameters \Drupal\Core\Session\AccountInterface $account: The current account. Overrid

AccountProxy::isAnonymous

public AccountProxy::isAnonymous() Returns TRUE if the account is anonymous. Return value bool TRUE if the account is anonymous. Overrides AccountInterface::isAnonymous File core/lib/Drupal/Core/Session/AccountProxy.php, line 95 Class AccountProxy A proxied implementation of AccountInterface. Namespace Drupal\Core\Session Code public function isAnonymous() { return $this->getAccount()->isAnonymous(); }

AccountProxy::setInitialAccountId

public AccountProxy::setInitialAccountId($account_id) Sets the id of the initial account. Never use this method, its sole purpose is to work around weird effects during mid-request container rebuilds. Parameters int $account_id: The id of the initial account. Overrides AccountProxyInterface::setInitialAccountId File core/lib/Drupal/Core/Session/AccountProxy.php, line 158 Class AccountProxy A proxied implementation of AccountInterface. Namespace Drupal\Core\Session Code public function

AccountProxy::getUsername

public AccountProxy::getUsername() Returns the unaltered login name of this account. Return value string An unsanitized plain-text string with the name of this account that is used to log in. Only display this name to admins and to the user who owns this account, and only in the context of the name used to log in. For any other display purposes, use \Drupal\Core\Session\AccountInterface::getDisplayName() instead. Overrides AccountInterface::getUsername Deprecated in Drupal 8.0.0, will be rem

AccountProxy::getRoles

public AccountProxy::getRoles($exclude_locked_roles = FALSE) Returns a list of roles. Parameters bool $exclude_locked_roles: (optional) If TRUE, locked roles (anonymous/authenticated) are not returned. Return value array List of role IDs. Overrides AccountInterface::getRoles File core/lib/Drupal/Core/Session/AccountProxy.php, line 74 Class AccountProxy A proxied implementation of AccountInterface. Namespace Drupal\Core\Session Code public function getRoles($exclude_locked_roles = FAL

AccountProxy::hasPermission

public AccountProxy::hasPermission($permission) Checks whether a user has a certain permission. Parameters string $permission: The permission string to check. Return value bool TRUE if the user has the permission, FALSE otherwise. Overrides AccountInterface::hasPermission File core/lib/Drupal/Core/Session/AccountProxy.php, line 81 Class AccountProxy A proxied implementation of AccountInterface. Namespace Drupal\Core\Session Code public function hasPermission($permission) { return $

AccountProxy::getTimeZone

public AccountProxy::getTimeZone() Returns the timezone of this account. Return value string Name of the timezone. Overrides AccountInterface::getTimeZone File core/lib/Drupal/Core/Session/AccountProxy.php, line 144 Class AccountProxy A proxied implementation of AccountInterface. Namespace Drupal\Core\Session Code public function getTimeZone() { return $this->getAccount()->getTimeZone(); }

AccountProxy::id

public AccountProxy::id() Returns the user ID or 0 for anonymous. Return value int The user ID. Overrides AccountInterface::id File core/lib/Drupal/Core/Session/AccountProxy.php, line 67 Class AccountProxy A proxied implementation of AccountInterface. Namespace Drupal\Core\Session Code public function id() { return $this->getAccount()->id(); }

AccountProxy::getPreferredLangcode

public AccountProxy::getPreferredLangcode($fallback_to_default = TRUE) Returns the preferred language code of the account. Parameters bool $fallback_to_default: (optional) Whether the return value will fall back to the site default language if the user has no language preference. Return value string The language code that is preferred by the account. If the preferred language is not set or is a language not configured anymore on the site, the site default is returned or an empty string is ret

AccountProxy::getAccountName

public AccountProxy::getAccountName() Returns the unaltered login name of this account. Return value string An unsanitized plain-text string with the name of this account that is used to log in. Only display this name to admins and to the user who owns this account, and only in the context of the name used to login. For any other display purposes, use \Drupal\Core\Session\AccountInterface::getDisplayName() instead. Overrides AccountInterface::getAccountName File core/lib/Drupal/Core/Session/Ac