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.
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. |
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Session!AccountInterface.php/interface/AccountInterface/8.1.x