User::getLastLoginTime

public User::getLastLoginTime() Returns the UNIX timestamp when the user last logged in. Return value int Timestamp of the last login time. Overrides UserInterface::getLastLoginTime File core/modules/user/src/Entity/User.php, line 259 Class User Defines the user entity class. Namespace Drupal\user\Entity Code public function getLastLoginTime() { return $this->get('login')->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::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::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::baseFieldDefinitions

public static User::baseFieldDefinitions(EntityTypeInterface $entity_type) Provides base field definitions for an entity type. Implementations typically use the class \Drupal\Core\Field\BaseFieldDefinition for creating the field definitions; for example a 'name' field could be defined as the following: $fields['name'] = BaseFieldDefinition::create('string') ->setLabel(t('Name')); By definition, base fields are fields that exist for every bundle. To provide definitions for fields that sho

User::checkExistingPassword

public User::checkExistingPassword(UserInterface $account_unchanged) Checks the existing password if set. Parameters \Drupal\user\UserInterface $account_unchanged: The unchanged user entity to compare against. Return value bool TRUE if the correct existing password was provided. Overrides UserInterface::checkExistingPassword See also UserInterface::setExistingPassword() File core/modules/user/src/Entity/User.php, line 397 Class User Defines the user entity class. Namespace Drupal\use

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; }