Defines an account interface which represents the current user.
Defines an object that has a user id, roles and can have session data. The interface is implemented both by the global session and the user entity.
Hierarchy
- interface \Drupal\Core\Session\AccountInterface
Related topics
- User accounts, permissions, and roles
- API for user accounts, access checking, roles, and permissions.
File
- core/lib/Drupal/Core/Session/AccountInterface.php, line 13
Namespace
Drupal\Core\Session
Members
Name | Modifiers | Type | Description |
---|---|---|---|
AccountInterface::ANONYMOUS_ROLE | constant | Role ID for anonymous users. | |
AccountInterface::AUTHENTICATED_ROLE | constant | Role ID for authenticated users. | |
AccountInterface::getAccountName | public | function | Returns the unaltered login name of this account. |
AccountInterface::getDisplayName | public | function | Returns the display name of this account. |
AccountInterface::getEmail | public | function | Returns the email address of this account. |
AccountInterface::getLastAccessedTime | public | function | The timestamp when the account last accessed the site. |
AccountInterface::getPreferredAdminLangcode | public | function | Returns the preferred administrative language code of the account. |
AccountInterface::getPreferredLangcode | public | function | Returns the preferred language code of the account. |
AccountInterface::getRoles | public | function | Returns a list of roles. |
AccountInterface::getTimeZone | public | function | Returns the timezone of this account. |
AccountInterface::getUsername Deprecated | public | function | Returns the unaltered login name of this account. |
AccountInterface::hasPermission | public | function | Checks whether a user has a certain permission. |
AccountInterface::id | public | function | Returns the user ID or 0 for anonymous. |
AccountInterface::isAnonymous | public | function | Returns TRUE if the account is anonymous. |
AccountInterface::isAuthenticated | public | function | Returns TRUE if the account is authenticated. |
Please login to continue.