Users

Implements \Symfony\Component\Security\Core\User\UserInterface

Users Entity implements the Users Interface from Symfony 4

ORM\Entity
ORM\Entity

(repositoryClass="App\Repository\UsersRepository")

UniqueEntity

(fields="email", message="Email already taken")

UniqueEntity

(fields="username", message="Username already taken")

ORM\Table

(name="users")

package

App\Entity

Methods

Users constructor.

__construct() 

Doctrine PrePersist actions triggered when record row is requested

createdOnPrePersit() 
ORM\PrePersist

Remove users credentials

eraseCredentials() 
todo
  • Complete this feature

Returns the record $created timestamp

getCreated() : integer

Response

integer

$created

Get the Users email

getEmail() : string

Response

string

$email

Get the foreign key for Groups ID relationship

getGroupId() : \App\Entity\Groups|null

Response

\App\Entity\Groups|null

Get the User ID

getId() : integer

Response

integer

Get the Users password

getPassword() : string

Response

string

$password

Return the Users plain text password

getPlainPassword() : string

Response

string

$plainPassword

Get Users group of Authentication Roles

getRoles() : array

Response

array

$roles

Salt Encryption placeholder - not used

getSalt() : null

Response

null

Returns the record $updated timestamp

getUpdated() : integer

Response

integer

$updated

Get the Users username

getUsername() : string

Response

string

$username

Sets the record $created timestamp

setCreated(integer $created) : $this

Arguments

$created

integer

Response

$this

Set the Users email

setEmail(string $email) 

Arguments

$email

string

Sets the foreign key for Groups ID relationship

setGroupId(\App\Entity\Groups|null $group_id) : \App\Entity\Users

Arguments

$group_id

\App\Entity\Groups|null

Response

\App\Entity\Users

Set the Users password

setPassword(string $password) 

Arguments

$password

string

Set the Users plain text password

setPlainPassword(string $password) 

Arguments

$password

string

Set Users group Roles

setRoles(array $roles) 

Arguments

$roles

array

Sets the record $updated timestamp

setUpdated(integer $updated) : $this

Arguments

$updated

integer

Response

$this

Set the Users username

setUsername(string $username) 

Arguments

$username

string

Doctrine PostPersist actions triggered after record row is inserted and before flush

updatedOnPostPersit() 
ORM\PostPersist

Properties

Auto generated ID

id : 
ORM\Id
ORM\Column

(type="integer")

ORM\GeneratedValue

(strategy="AUTO")

Type(s)

Users email address

email : 
ORM\Column

(type="string", length=255, unique=true)

Assert\NotBlank
Assert\Email

Type(s)

Username handle for email address

username : 
ORM\Column

(type="string", length=255, unique=true)

Assert\NotBlank

Type(s)

Users plain text password

plainPassword : 
Assert\NotBlank

()

Assert\Length

(max=4096)

Type(s)

Users bcrypt encrypted password

password : 

The below length depends on the "algorithm" you use for encoding the password, but this works well with bcrypt.

ORM\Column

(type="string", length=64)

Type(s)

Users authentication roles array

roles : 
ORM\Column

(type="array")

Type(s)

UTC timestamp of when record was created

created : integer
var
Gedmo\Timestampable

(on="create")

ORM\Column

(type="integer", name="created", nullable=true)

Type(s)

integer

UTC record of when record was last updated

updated : integer
var
Gedmo\Timestampable

(on="update")

ORM\Column

(type="integer", name="updated", nullable=true)

Type(s)

integer

Foreign key relationship of Groups ID key as membership

group_id : 
ORM\ManyToOne

(targetEntity="App\Entity\Groups", inversedBy="users")

Type(s)