User
in package
implements
UserInterface
Tags
Interfaces, Classes, Traits and Enums
- UserInterface
- Represents the interface that all user classes must implement.
Table of Contents
- $id : mixed
- $password : string
- $roles : mixed
- $username : mixed
- eraseCredentials() : mixed
- Removes sensitive data from the user.
- getId() : int|null
- 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
- Returning a salt is only needed, if you are not using a modern hashing algorithm (e.g. bcrypt or sodium) in your security.yaml.
- getUsername() : string
- A visual identifier that represents this user.
- setPassword() : self
- setRoles() : self
- setUsername() : self
Properties
$id
private
mixed
$id
Tags
$password
private
string
$password
The hashed password
Tags
$roles
private
mixed
$roles
= []
Tags
$username
private
mixed
$username
Tags
Methods
eraseCredentials()
Removes sensitive data from the user.
public
eraseCredentials() : mixed
Tags
Return values
mixed —getId()
public
getId() : int|null
Return values
int|null —getPassword()
Returns the password used to authenticate the user.
public
getPassword() : string|null
Tags
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>
Tags
Return values
array<string|int, \Symfony\Component\Security\Core\Role\Role|string> —The user roles
getSalt()
Returning a salt is only needed, if you are not using a modern hashing algorithm (e.g. bcrypt or sodium) in your security.yaml.
public
getSalt() : string|null
Tags
Return values
string|null —The salt
getUsername()
A visual identifier that represents this user.
public
getUsername() : string
Tags
Return values
string —The username
setPassword()
public
setPassword(string $password) : self
Parameters
- $password : string
Return values
self —setRoles()
public
setRoles(array<string|int, mixed> $roles) : self
Parameters
- $roles : array<string|int, mixed>
Return values
self —setUsername()
public
setUsername(string $username) : self
Parameters
- $username : string