Drupal 8  8.0.2
UserInterface Interface Reference
Inheritance diagram for UserInterface:

Public Member Functions

 hasRole ($rid)
 
 addRole ($rid)
 
 removeRole ($rid)
 
 setUsername ($username)
 
 getPassword ()
 
 setPassword ($password)
 
 setEmail ($mail)
 
 getCreatedTime ()
 
 setLastAccessTime ($timestamp)
 
 getLastLoginTime ()
 
 setLastLoginTime ($timestamp)
 
 isActive ()
 
 isBlocked ()
 
 activate ()
 
 block ()
 
 getInitialEmail ()
 
 setExistingPassword ($password)
 
 checkExistingPassword (UserInterface $account_unchanged)
 
- Public Member Functions inherited from ContentEntityInterface
 hasTranslationChanges ()
 
 setRevisionTranslationAffected ($affected)
 
 isRevisionTranslationAffected ()
 
- Public Member Functions inherited from FieldableEntityInterface
 hasField ($field_name)
 
 getFieldDefinition ($name)
 
 getFieldDefinitions ()
 
 toArray ()
 
 get ($field_name)
 
 set ($field_name, $value, $notify=TRUE)
 
 getFields ($include_computed=TRUE)
 
 getTranslatableFields ($include_computed=TRUE)
 
 onChange ($field_name)
 
 validate ()
 
 isValidationRequired ()
 
 setValidationRequired ($required)
 
- Public Member Functions inherited from EntityInterface
 uuid ()
 
 id ()
 
 language ()
 
 isNew ()
 
 enforceIsNew ($value=TRUE)
 
 getEntityTypeId ()
 
 bundle ()
 
 label ()
 
 urlInfo ($rel= 'canonical', array $options=array())
 
 toUrl ($rel= 'canonical', array $options=array())
 
 url ($rel= 'canonical', $options=array())
 
 link ($text=NULL, $rel= 'canonical', array $options=[])
 
 toLink ($text=NULL, $rel= 'canonical', array $options=[])
 
 hasLinkTemplate ($key)
 
 uriRelationships ()
 
 save ()
 
 delete ()
 
 preSave (EntityStorageInterface $storage)
 
 postSave (EntityStorageInterface $storage, $update=TRUE)
 
 postCreate (EntityStorageInterface $storage)
 
 createDuplicate ()
 
 getEntityType ()
 
 referencedEntities ()
 
 getOriginalId ()
 
 getCacheTagsToInvalidate ()
 
 setOriginalId ($id)
 
 getTypedData ()
 
 getConfigDependencyKey ()
 
 getConfigDependencyName ()
 
 getConfigTarget ()
 
- Public Member Functions inherited from AccessibleInterface
 access ($operation, AccountInterface $account=NULL, $return_as_object=FALSE)
 
- Public Member Functions inherited from CacheableDependencyInterface
 getCacheContexts ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 
- Public Member Functions inherited from RefinableCacheableDependencyInterface
 addCacheContexts (array $cache_contexts)
 
 addCacheTags (array $cache_tags)
 
 mergeCacheMaxAge ($max_age)
 
 addCacheableDependency ($other_object)
 
- Public Member Functions inherited from RevisionableInterface
 isNewRevision ()
 
 setNewRevision ($value=TRUE)
 
 getRevisionId ()
 
 isDefaultRevision ($new_value=NULL)
 
 preSaveRevision (EntityStorageInterface $storage,\stdClass $record)
 
- Public Member Functions inherited from TranslatableInterface
 language ()
 
 isDefaultTranslation ()
 
 isNewTranslation ()
 
 getTranslationLanguages ($include_default=TRUE)
 
 getTranslation ($langcode)
 
 getUntranslated ()
 
 hasTranslation ($langcode)
 
 addTranslation ($langcode, array $values=array())
 
 removeTranslation ($langcode)
 
 isTranslatable ()
 
- Public Member Functions inherited from EntityChangedInterface
 getChangedTime ()
 
 setChangedTime ($timestamp)
 
 getChangedTimeAcrossTranslations ()
 

Additional Inherited Members

- Static Public Member Functions inherited from FieldableEntityInterface
static baseFieldDefinitions (EntityTypeInterface $entity_type)
 
static bundleFieldDefinitions (EntityTypeInterface $entity_type, $bundle, array $base_field_definitions)
 
- Static Public Member Functions inherited from EntityInterface
static load ($id)
 
static loadMultiple (array $ids=NULL)
 
static create (array $values=array())
 
static preCreate (EntityStorageInterface $storage, array &$values)
 
static preDelete (EntityStorageInterface $storage, array $entities)
 
static postDelete (EntityStorageInterface $storage, array $entities)
 
static postLoad (EntityStorageInterface $storage, array &$entities)
 

Detailed Description

Provides an interface defining a user entity.

Member Function Documentation

activate ( )

Activates the user.

Returns
The called user entity.

Implemented in User.

addRole (   $rid)

Add a role to a user.

Parameters
string$ridThe role ID to add.

Implemented in User.

block ( )

Blocks the user.

Returns
The called user entity.

Implemented in User.

checkExistingPassword ( UserInterface  $account_unchanged)

Checks the existing password if set.

Parameters
\Drupal\user\UserInterface$account_unchangedThe unchanged user entity to compare against.
Returns
bool TRUE if the correct existing password was provided.
See Also
UserInterface::setExistingPassword().

Implemented in User.

getCreatedTime ( )

Returns the creation time of the user as a UNIX timestamp.

Returns
int Timestamp of the creation date.

Implemented in User.

getInitialEmail ( )

Returns the email that was used when the user was registered.

Returns
string Initial email address of the user.

Implemented in User.

getLastLoginTime ( )

Returns the UNIX timestamp when the user last logged in.

Returns
int Timestamp of the last login time.

Implemented in User.

Referenced by UserController\confirmCancel(), and UserStorage\updateLastLoginTimestamp().

Here is the caller graph for this function:

getPassword ( )

Returns the hashed password.

Returns
string The hashed password.

Implemented in User.

Referenced by User\checkExistingPassword().

Here is the caller graph for this function:

hasRole (   $rid)

Whether a user has a certain role.

Parameters
string$ridThe role ID to check.
Returns
bool Returns TRUE if the user has the role, otherwise FALSE.

Implemented in User.

isActive ( )

Returns TRUE if the user is active.

Returns
bool TRUE if the user is active, false otherwise.

Implemented in User.

isBlocked ( )

Returns TRUE if the user is blocked.

Returns
bool TRUE if the user is blocked, false otherwise.

Implemented in User.

removeRole (   $rid)

Remove a role from a user.

Parameters
string$ridThe role ID to remove.

Implemented in User.

setEmail (   $mail)

Sets the email address of the user.

Parameters
string$mailThe new email address of the user.
Returns
The called user entity.

Implemented in User.

setExistingPassword (   $password)

Sets the existing plain text password.

Required for validation when changing the password, name or email fields.

Parameters
string$passwordThe existing plain text password of the user.
Returns
$this

Implemented in User.

setLastAccessTime (   $timestamp)

Sets the UNIX timestamp when the user last accessed the site..

Parameters
int$timestampTimestamp of the last access.
Returns
The called user entity.

Implemented in User.

setLastLoginTime (   $timestamp)

Sets the UNIX timestamp when the user last logged in.

Parameters
int$timestampTimestamp of the last login time.
Returns
The called user entity.

Implemented in User.

setPassword (   $password)

Sets the user password.

Parameters
string$passwordThe new unhashed password.
Returns
The called user entity.

Implemented in User.

setUsername (   $username)

Sets the username of this account.

Parameters
string$usernameThe new user name.
Returns
The called user entity.

Implemented in User.


The documentation for this interface was generated from the following file: