Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AccountInterface.php

function AccountInterface::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.

3 methods override AccountInterface::getAccountName()
AccountProxy::getAccountName in core/lib/Drupal/Core/Session/AccountProxy.php
Returns the unaltered login name of this account.
User::getAccountName in core/modules/user/src/Entity/User.php
Returns the unaltered login name of this account.
UserSession::getAccountName in core/lib/Drupal/Core/Session/UserSession.php
Returns the unaltered login name of this account.

File

core/lib/Drupal/Core/Session/AccountInterface.php, line 115

Class

AccountInterface
Defines an account interface which represents the current user.

Namespace

Drupal\Core\Session

Code

public function getAccountName();

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal