User
in package
implements
UserInterface, EquatableInterface, AdvancedUserInterface
User is the user implementation used by the in-memory user provider.
This should not be used for anything else.
Tags
Interfaces, Classes, Traits and Enums
- UserInterface
- Represents the interface that all user classes must implement.
- EquatableInterface
- EquatableInterface used to test if two objects are equal in security and re-authentication context.
- AdvancedUserInterface
- Adds extra features to a user class related to account status flags.
Table of Contents
- $accountNonExpired : mixed
- $accountNonLocked : mixed
- $credentialsNonExpired : mixed
- $enabled : mixed
- $extraFields : mixed
- $password : mixed
- $roles : mixed
- $username : mixed
- __construct() : mixed
- __toString() : string
- eraseCredentials() : mixed
- Removes sensitive data from the user.
- getExtraFields() : array<string|int, mixed>
- getPassword() : string|null
- Returns the password used to authenticate the user.
- getRoles() : array<string|int, \Symfony\Component\Security\Core\Role\Role|string>
- Returns the roles granted to the user.
- getSalt() : string|null
- Returns the salt that was originally used to encode the password.
- getUsername() : string
- Returns the username used to authenticate the user.
- isAccountNonExpired() : bool
- Checks whether the user's account has expired.
- isAccountNonLocked() : bool
- Checks whether the user is locked.
- isCredentialsNonExpired() : bool
- Checks whether the user's credentials (password) has expired.
- isEnabled() : bool
- Checks whether the user is enabled.
- isEqualTo() : bool
- The equality comparison should neither be done by referential equality nor by comparing identities (i.e. getId() === getId()).
- setPassword() : mixed
Properties
$accountNonExpired
private
mixed
$accountNonExpired
$accountNonLocked
private
mixed
$accountNonLocked
$credentialsNonExpired
private
mixed
$credentialsNonExpired
$enabled
private
mixed
$enabled
$extraFields
private
mixed
$extraFields
$password
private
mixed
$password
$roles
private
mixed
$roles
$username
private
mixed
$username
Methods
__construct()
public
__construct(string|null $username, string|null $password[, array<string|int, mixed> $roles = [] ][, bool $enabled = true ][, bool $userNonExpired = true ][, bool $credentialsNonExpired = true ][, bool $userNonLocked = true ][, array<string|int, mixed> $extraFields = [] ]) : mixed
Parameters
- $username : string|null
- $password : string|null
- $roles : array<string|int, mixed> = []
- $enabled : bool = true
- $userNonExpired : bool = true
- $credentialsNonExpired : bool = true
- $userNonLocked : bool = true
- $extraFields : array<string|int, mixed> = []
Return values
mixed —__toString()
public
__toString() : string
Return values
string —eraseCredentials()
Removes sensitive data from the user.
public
eraseCredentials() : mixed
Return values
mixed —getExtraFields()
public
getExtraFields() : array<string|int, mixed>
Return values
array<string|int, mixed> —getPassword()
Returns the password used to authenticate the user.
public
getPassword() : string|null
Return values
string|null —The encoded password if any
getRoles()
Returns the roles granted to the user.
public
getRoles() : array<string|int, \Symfony\Component\Security\Core\Role\Role|string>
Return values
array<string|int, \Symfony\Component\Security\Core\Role\Role|string> —The user roles
getSalt()
Returns the salt that was originally used to encode the password.
public
getSalt() : string|null
Return values
string|null —The salt
getUsername()
Returns the username used to authenticate the user.
public
getUsername() : string
Return values
string —The username
isAccountNonExpired()
Checks whether the user's account has expired.
public
isAccountNonExpired() : bool
Return values
bool —true if the user's account is non expired, false otherwise
isAccountNonLocked()
Checks whether the user is locked.
public
isAccountNonLocked() : bool
Return values
bool —true if the user is not locked, false otherwise
isCredentialsNonExpired()
Checks whether the user's credentials (password) has expired.
public
isCredentialsNonExpired() : bool
Return values
bool —true if the user's credentials are non expired, false otherwise
isEnabled()
Checks whether the user is enabled.
public
isEnabled() : bool
Return values
bool —true if the user is enabled, false otherwise
isEqualTo()
The equality comparison should neither be done by referential equality nor by comparing identities (i.e. getId() === getId()).
public
isEqualTo(UserInterface $user) : bool
Parameters
- $user : UserInterface
Return values
bool —setPassword()
public
setPassword(string $password) : mixed
Parameters
- $password : string