User::getInitialEmail

public User::getInitialEmail() Returns the email that was used when the user was registered. Return value string Initial email address of the user. Overrides UserInterface::getInitialEmail File core/modules/user/src/Entity/User.php, line 339 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public function getInitialEmail() { return $this->get('init')->value; }

User::getAllowedConfigurableLanguageCodes

public static User::getAllowedConfigurableLanguageCodes() Defines allowed configurable language codes for AllowedValues constraints. Return value string[] The allowed values. File core/modules/user/src/Entity/User.php, line 566 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public static function getAllowedConfigurableLanguageCodes() { return array_keys(\Drupal::languageManager()->getLanguages(LanguageInterface::STATE_CONFIGURABLE)); }

User::getAnonymousUser

public static User::getAnonymousUser() Returns an anonymous user entity. Return value \Drupal\user\UserInterface An anonymous user entity. File core/modules/user/src/Entity/User.php, line 407 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public static function getAnonymousUser() { if (!isset(static::$anonymousUser)) { // @todo Use the entity factory once available, see // https://www.drupal.org/node/1867228. $entity_manager = \Drupal::ent

User::getCreatedTime

public User::getCreatedTime() Returns the creation time of the user as a UNIX timestamp. Return value int Timestamp of the creation date. Overrides UserInterface::getCreatedTime File core/modules/user/src/Entity/User.php, line 237 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public function getCreatedTime() { return $this->get('created')->value; }

User::getDisplayName

public User::getDisplayName() Returns the display name of this account. By default, the passed-in object's 'name' property is used if it exists, or else, the site-defined value for the 'anonymous' variable. However, a module may override this by implementing hook_user_format_name_alter(&$name, $account). Return value string|\Drupal\Component\Render\MarkupInterface Either a string that will be auto-escaped on output or a MarkupInterface object that is already HTML escaped. Either is safe to

User::getAccountName

public User::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/modules/user/src/Entity/User.php,

User::getAllowedTimezones

public static User::getAllowedTimezones() Defines allowed timezones for the field's AllowedValues constraint. Return value string[] The allowed values. File core/modules/user/src/Entity/User.php, line 556 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public static function getAllowedTimezones() { return array_keys(system_time_zones()); }

User::activate

public User::activate() Activates the user. Return value \Drupal\user\UserInterface The called user entity. Overrides UserInterface::activate File core/modules/user/src/Entity/User.php, line 288 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public function activate() { $this->get('status')->value = 1; return $this; }

User::block

public User::block() Blocks the user. Return value \Drupal\user\UserInterface The called user entity. Overrides UserInterface::block File core/modules/user/src/Entity/User.php, line 296 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public function block() { $this->get('status')->value = 0; return $this; }

User::addRole

public User::addRole($rid) Add a role to a user. Parameters string $rid: The role ID to add. Overrides UserInterface::addRole File core/modules/user/src/Entity/User.php, line 174 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public function addRole($rid) { if (in_array($rid, [RoleInterface::AUTHENTICATED_ID, RoleInterface::ANONYMOUS_ID])) { throw new \InvalidArgumentException('Anonymous or authenticated role ID must not be assigned manually.'); }