class User extends AbstractHuman implements AdvancedUserInterface (View source)

User Entity.

Properties

protected $id from AbstractEntity
protected DateTime $createdAt from AbstractDateTimed
protected DateTime $updatedAt from AbstractDateTimed
protected $email from AbstractHuman
protected $firstName from AbstractHuman
protected $lastName from AbstractHuman
protected $phone from AbstractHuman
protected $company from AbstractHuman
protected $job from AbstractHuman
protected DateTime $birthday from AbstractHuman
protected bool $sendCreationConfirmationEmail
protected $facebookName
protected $pictureUrl
protected boolean $enabled
protected string $confirmationToken
protected DateTime $passwordRequestedAt

Methods

int
getId()

No description

setId(int $id)

No description

getCreatedAt()

No description

setCreatedAt(DateTime $createdAt)

No description

getUpdatedAt()

No description

setUpdatedAt(DateTime $updatedAt)

No description

preUpdate()

No description

prePersist()

No description

resetDates()

Set creation and update date to now.

string
getEmail()

No description

$this
setEmail(string $email)

No description

string
getFirstName()

No description

$this
setFirstName(string $firstName)

No description

string
getLastName()

No description

$this
setLastName(string $lastName)

No description

string
getCompany()

No description

$this
setCompany(string $company)

No description

string
getJob()

No description

$this
setJob(string $job)

No description

getBirthday()

No description

$this
setBirthday(DateTime $birthday = null)

No description

mixed
getPhone()

Gets the value of phone.

setPhone(mixed $phone)

Sets the value of phone.

bool
willSendCreationConfirmationEmail()

Tells if we need Roadiz to send a default email when User will be persisted. Default: false.

sendCreationConfirmationEmail(bool $sendCreationConfirmationEmail)

Set if we need Roadiz to send a default email when User will be persisted.

string
getUsername()

No description

string
setUsername(string $username)

No description

string
getIdentifier()

Get available user name data, first name and last name or username as a last try.

string
getFacebookName()

Get facebook profile name to grab public infos such as picture

string
setFacebookName(string $facebookName)

No description

string
getPictureUrl()

No description

string
setPictureUrl(string $pictureUrl)

No description

string
getSalt()

No description

string
setSalt(string $salt)

No description

string
getPassword()

No description

string
setPassword(string $password)

No description

string
getPlainPassword()

No description

setPlainPassword(string $plainPassword)

No description

bool
isEnabled()

Checks whether the user is enabled.

setEnabled(boolean $enabled)

No description

getLastLogin()

No description

setLastLogin(DateTime $lastLogin)

No description

string
getConfirmationToken()

Get random string sent to the user email address in order to verify it.

$this
setConfirmationToken(string $confirmationToken)

Set random string sent to the user email address in order to verify it.

$this
setPasswordRequestedAt(DateTime $date = null)

Sets the timestamp that the user requested a password reset.

null|DateTime
getPasswordRequestedAt()

Gets the timestamp that the user requested a password reset.

boolean
isPasswordRequestNonExpired(int $ttl)

Check if password reset request has expired.

ArrayCollection
getRolesEntities()

Get roles entities

array
getRoles()

Get roles names as a simple array, combining groups roles.

$this
addRole(Role $role)

Add a role object to current user.

$this
removeRole(Role $role)

Remove role from current user.

void
eraseCredentials()

Removes sensitive data from the user.

ArrayCollection
getGroups()

No description

$this
addGroup(Group $group)

Insert user into group.

$this
removeGroup(Group $group)

Remove user from group

array
getGroupNames()

Get current user groups name.

boolean
getExpired()

Return strictly forced expiration status.

$this
setExpired(boolean $expired)

No description

bool
isAccountNonExpired()

Checks whether the user's account has expired.

bool
isAccountNonLocked()

Checks whether the user is locked.

setLocked($locked)

No description

boolean
equals(User $user)

[email protected]}

setCredentialsExpiresAt(DateTime $date = null)

No description

boolean
getCredentialsExpired()

Return strictly forced credentials expiration status.

$this
setCredentialsExpired(boolean $newcredentialsExpired)

No description

bool
isCredentialsNonExpired()

Checks whether the user's credentials (password) has expired.

setExpiresAt(DateTime $date = null)

No description

getExpiresAt()

No description

setChroot(Node $chroot = null)

No description

getChroot()

No description

string
getGravatarUrl()

Get prototype abstract gravatar url.

__construct()

Constructor

getHandler()

No description

getViewer()

No description

string
__toString()

No description

Details

int getId()

Return Value

int

AbstractEntity setId(int $id)

Parameters

int $id

Return Value

AbstractEntity

DateTime getCreatedAt()

Return Value

DateTime

AbstractEntity setCreatedAt(DateTime $createdAt)

Parameters

DateTime $createdAt

Return Value

AbstractEntity

DateTime getUpdatedAt()

Return Value

DateTime

AbstractEntity setUpdatedAt(DateTime $updatedAt)

Parameters

DateTime $updatedAt

Return Value

AbstractEntity

preUpdate()

prePersist()

AbstractEntity resetDates()

Set creation and update date to now.

Return Value

AbstractEntity

string getEmail()

Return Value

string

$this setEmail(string $email)

Parameters

string $email

Return Value

$this

string getFirstName()

Return Value

string

$this setFirstName(string $firstName)

Parameters

string $firstName

Return Value

$this

string getLastName()

Return Value

string

$this setLastName(string $lastName)

Parameters

string $lastName

Return Value

$this

string getCompany()

Return Value

string

$this setCompany(string $company)

Parameters

string $company

Return Value

$this

string getJob()

Return Value

string

$this setJob(string $job)

Parameters

string $job

Return Value

$this

DateTime getBirthday()

Return Value

DateTime

$this setBirthday(DateTime $birthday = null)

Parameters

DateTime $birthday

Return Value

$this

mixed getPhone()

Gets the value of phone.

Return Value

mixed

AbstractHuman setPhone(mixed $phone)

Sets the value of phone.

Parameters

mixed $phone the phone

Return Value

AbstractHuman

bool willSendCreationConfirmationEmail()

Tells if we need Roadiz to send a default email when User will be persisted. Default: false.

Return Value

bool

User sendCreationConfirmationEmail(bool $sendCreationConfirmationEmail)

Set if we need Roadiz to send a default email when User will be persisted.

Parameters

bool $sendCreationConfirmationEmail

Return Value

User

string getUsername()

Return Value

string $username

string setUsername(string $username)

Parameters

string $username

Return Value

string $username

string getIdentifier()

Get available user name data, first name and last name or username as a last try.

Return Value

string

string getFacebookName()

Get facebook profile name to grab public infos such as picture

Return Value

string

string setFacebookName(string $facebookName)

Parameters

string $facebookName

Return Value

string $facebookName

string getPictureUrl()

Return Value

string

string setPictureUrl(string $pictureUrl)

Parameters

string $pictureUrl

Return Value

string $pictureURL

string getSalt()

Return Value

string

string setSalt(string $salt)

Parameters

string $salt

Return Value

string $salt

string getPassword()

Return Value

string $password

string setPassword(string $password)

Parameters

string $password

Return Value

string $password

string getPlainPassword()

Return Value

string $plainPassword

User setPlainPassword(string $plainPassword)

Parameters

string $plainPassword

Return Value

User

bool isEnabled()

Checks whether the user is enabled.

Internally, if this method returns false, the authentication system will throw a DisabledException and prevent login.

Return Value

bool true if the user is enabled, false otherwise

See also

DisabledException

User setEnabled(boolean $enabled)

Parameters

boolean $enabled

Return Value

User

DateTime getLastLogin()

Return Value

DateTime $lastLogin

User setLastLogin(DateTime $lastLogin)

Parameters

DateTime $lastLogin

Return Value

User

string getConfirmationToken()

Get random string sent to the user email address in order to verify it.

Return Value

string

$this setConfirmationToken(string $confirmationToken)

Set random string sent to the user email address in order to verify it.

Parameters

string $confirmationToken

Return Value

$this

$this setPasswordRequestedAt(DateTime $date = null)

Sets the timestamp that the user requested a password reset.

Parameters

DateTime $date

Return Value

$this

null|DateTime getPasswordRequestedAt()

Gets the timestamp that the user requested a password reset.

Return Value

null|DateTime

boolean isPasswordRequestNonExpired(int $ttl)

Check if password reset request has expired.

Parameters

int $ttl Password request time to live.

Return Value

boolean

ArrayCollection getRolesEntities()

Get roles entities

Return Value

ArrayCollection

array getRoles()

Get roles names as a simple array, combining groups roles.

Return Value

array

$this addRole(Role $role)

Add a role object to current user.

Parameters

Role $role

Return Value

$this

$this removeRole(Role $role)

Remove role from current user.

Parameters

Role $role

Return Value

$this

void eraseCredentials()

Removes sensitive data from the user.

Return Value

void

ArrayCollection getGroups()

Return Value

ArrayCollection

$this addGroup(Group $group)

Insert user into group.

Parameters

Group $group

Return Value

$this

$this removeGroup(Group $group)

Remove user from group

Parameters

Group $group

Return Value

$this

array getGroupNames()

Get current user groups name.

Return Value

array Array of strings

boolean getExpired()

Return strictly forced expiration status.

Return Value

boolean

$this setExpired(boolean $expired)

Parameters

boolean $expired

Return Value

$this

bool isAccountNonExpired()

Checks whether the user's account has expired.

Combines expiresAt date-time limit AND expired boolean value.

Internally, if this method returns false, the authentication system will throw an AccountExpiredException and prevent login.

Return Value

bool true if the user's account is non expired, false otherwise

See also

AccountExpiredException

bool isAccountNonLocked()

Checks whether the user is locked.

Internally, if this method returns false, the authentication system will throw a LockedException and prevent login.

Return Value

bool true if the user is not locked, false otherwise

See also

LockedException

setLocked($locked)

Parameters

$locked

boolean equals(User $user)

[email protected]}

Parameters

User $user

Return Value

boolean

User setCredentialsExpiresAt(DateTime $date = null)

Parameters

DateTime $date

Return Value

User

DateTime getCredentialsExpiresAt()

Return Value

DateTime

boolean getCredentialsExpired()

Return strictly forced credentials expiration status.

Return Value

boolean

$this setCredentialsExpired(boolean $newcredentialsExpired)

Parameters

boolean $newcredentialsExpired

Return Value

$this

bool isCredentialsNonExpired()

Checks whether the user's credentials (password) has expired.

Combines credentialsExpiresAt date-time limit AND credentialsExpired boolean value.

Internally, if this method returns false, the authentication system will throw a CredentialsExpiredException and prevent login.

Return Value

bool true if the user's credentials are non expired, false otherwise

See also

CredentialsExpiredException

User setExpiresAt(DateTime $date = null)

Parameters

DateTime $date

Return Value

User

DateTime getExpiresAt()

Return Value

DateTime

User setChroot(Node $chroot = null)

Parameters

Node $chroot

Return Value

User

Node getChroot()

Return Value

Node

string getGravatarUrl()

Get prototype abstract gravatar url.

Return Value

string

__construct()

Constructor

UserHandler getHandler()

Return Value

UserHandler

UserViewer getViewer()

Return Value

UserViewer

string __toString()

Return Value

string $text