PHP Class FOS\UserBundle\Model\User

Author: Thibault Duplessis ([email protected])
Author: Johannes M. Schmitt ([email protected])
Inheritance: implements FOS\UserBundle\Model\UserInterface, implements FOS\UserBundle\Model\GroupableInterface
Afficher le fichier Open project: KnpLabs/KnpUserBundle Class Usage Examples

Protected Properties

Свойство Type Description
$algorithm string The algorithm to use for hashing
$confirmationToken string Random string sent to the user email address in order to verify it
$createdAt DateTime
$credentialsExpireAt DateTime
$credentialsExpired boolean
$email string
$emailCanonical string
$enabled boolean
$expired boolean
$expiresAt DateTime
$groups Doctrine\Common\Collections\Collection
$id
$lastLogin DateTime
$locked boolean
$password string Encrypted password. Must be persisted.
$passwordRequestedAt DateTime
$plainPassword string Plain password. Used for model validation. Must not be persisted.
$roles array
$salt string The salt to use for hashing
$updatedAt DateTime
$username string
$usernameCanonical string

Méthodes publiques

Méthode Description
__construct ( )
__toString ( )
addGroup ( FOS\UserBundle\Model\GroupInterface $group ) : null Add a group to the user groups
addRole ( $role )
equals ( Symfony\Component\Security\Core\User\AccountInterface $account ) : boolean Implementation of AccountInterface.
eraseCredentials ( ) Removes sensitive data from the user.
generateConfirmationToken ( ) : null Generate confirmationToken if it is not set
getAlgorithm ( )
getConfirmationToken ( ) : string Get confirmationToken
getCreatedAt ( ) : DateTime
getEmail ( ) : string Get email
getEmailCanonical ( ) : string Get the canonical email in search and sort queries
getGroupNames ( ) : array Gets the name of the groups which includes the user
getGroups ( ) : Doctrine\Common\Collections\Collection Get groups granted to the user
getId ( ) : mixed Return the user unique id
getLastLogin ( ) : DateTime
getPassword ( ) : string Implements AccountInterface Get the encrypted password
getPasswordRequestedAt ( ) : DateTime Get the timestamp that the user requested a password reset.
getPlainPassword ( )
getRoles ( ) : array Return the user roles Implements AccountInterface
getSalt ( ) : string Implementation of AccountInterface
getUpdatedAt ( ) : DateTime
getUsername ( ) : string
getUsernameCanonical ( ) : string Get the canonical username in search and sort queries
hasGroup ( string $name ) : boolean Indicates whether the user belongs to the specified group or not
hasRole ( string $role ) : void Never use this to check if this user has access to anything!
incrementCreatedAt ( )
incrementUpdatedAt ( )
isAccountNonExpired ( ) : boolean Checks whether the user's account has expired.
isAccountNonLocked ( ) : boolean Checks whether the user is locked.
isCredentialsExpired ( )
isCredentialsNonExpired ( ) : boolean Checks whether the user's credentials (password) has expired.
isEnabled ( ) : boolean Checks whether the user is enabled.
isExpired ( )
isLocked ( )
isPasswordRequestNonExpired ( integer $ttl ) : boolean Checks whether the password reset request has expired.
isSuperAdmin ( ) : boolean Tell if the the given user has the super admin role
isUser ( FOS\UserBundle\Model\UserInterface $user = null ) : boolean Tell if the the given user is this user Useful when not hydrating all fields.
removeGroup ( FOS\UserBundle\Model\GroupInterface $group ) : null Remove a group from the user groups
removeRole ( $role )
setAlgorithm ( $algorithm )
setConfirmationToken ( $confirmationToken ) : null Set confirmationToken
setCredentialsExpireAt ( DateTime $date )
setCredentialsExpired ( $boolean )
setEmail ( string $email ) Set email.
setEmailCanonical ( string $emailCanonical ) Set emailCanonical.
setEnabled ( boolean $boolean )
setExpired ( boolean $boolean ) : void Sets this user to expired
setExpiresAt ( DateTime $date )
setLastLogin ( DateTime $time )
setLocked ( $boolean )
setPassword ( string $password ) : void Sets the hashed password.
setPasswordRequestedAt ( DateTime $date ) Set the timestamp that the user requested a password reset.
setPlainPassword ( $password )
setRoles ( array $roles )
setSuperAdmin ( boolean $boolean ) : void Sets the super admin status
setUsername ( string $username ) Set username.
setUsernameCanonical ( string $usernameCanonical ) Set usernameCanonical.

Method Details

__construct() public méthode

public __construct ( )

__toString() public méthode

public __toString ( )

addGroup() public méthode

Add a group to the user groups
public addGroup ( FOS\UserBundle\Model\GroupInterface $group ) : null
$group FOS\UserBundle\Model\GroupInterface
Résultat null

addRole() public méthode

public addRole ( $role )

equals() public méthode

Implementation of AccountInterface.
public equals ( Symfony\Component\Security\Core\User\AccountInterface $account ) : boolean
$account Symfony\Component\Security\Core\User\AccountInterface
Résultat boolean

eraseCredentials() public méthode

Implements AccountInterface
public eraseCredentials ( )

generateConfirmationToken() public méthode

Generate confirmationToken if it is not set
public generateConfirmationToken ( ) : null
Résultat null

getAlgorithm() public méthode

public getAlgorithm ( )

getConfirmationToken() public méthode

Get confirmationToken
public getConfirmationToken ( ) : string
Résultat string

getCreatedAt() public méthode

public getCreatedAt ( ) : DateTime
Résultat DateTime

getEmail() public méthode

Get email
public getEmail ( ) : string
Résultat string

getEmailCanonical() public méthode

Get the canonical email in search and sort queries
public getEmailCanonical ( ) : string
Résultat string

getGroupNames() public méthode

Gets the name of the groups which includes the user
public getGroupNames ( ) : array
Résultat array

getGroups() public méthode

Get groups granted to the user
public getGroups ( ) : Doctrine\Common\Collections\Collection
Résultat Doctrine\Common\Collections\Collection

getId() public méthode

Return the user unique id
public getId ( ) : mixed
Résultat mixed

getLastLogin() public méthode

public getLastLogin ( ) : DateTime
Résultat DateTime

getPassword() public méthode

Implements AccountInterface Get the encrypted password
public getPassword ( ) : string
Résultat string

getPasswordRequestedAt() public méthode

Get the timestamp that the user requested a password reset.
public getPasswordRequestedAt ( ) : DateTime
Résultat DateTime

getPlainPassword() public méthode

public getPlainPassword ( )

getRoles() public méthode

Return the user roles Implements AccountInterface
public getRoles ( ) : array
Résultat array The roles

getSalt() public méthode

Implementation of AccountInterface
public getSalt ( ) : string
Résultat string

getUpdatedAt() public méthode

public getUpdatedAt ( ) : DateTime
Résultat DateTime

getUsername() public méthode

public getUsername ( ) : string
Résultat string

getUsernameCanonical() public méthode

Get the canonical username in search and sort queries
public getUsernameCanonical ( ) : string
Résultat string

hasGroup() public méthode

Indicates whether the user belongs to the specified group or not
public hasGroup ( string $name ) : boolean
$name string Name of the group
Résultat boolean

hasRole() public méthode

Use the SecurityContext, or an implementation of AccessDecisionManager instead, e.g. $securityContext->vote('ROLE_USER');
public hasRole ( string $role ) : void
$role string
Résultat void

incrementCreatedAt() public méthode

public incrementCreatedAt ( )

incrementUpdatedAt() public méthode

public incrementUpdatedAt ( )

isAccountNonExpired() public méthode

Implements AdvancedAccountInterface
public isAccountNonExpired ( ) : boolean
Résultat boolean true if the user's account is non expired, false otherwise

isAccountNonLocked() public méthode

Implements AdvancedAccountInterface
public isAccountNonLocked ( ) : boolean
Résultat boolean true if the user is not locked, false otherwise

isCredentialsExpired() public méthode

isCredentialsNonExpired() public méthode

Implements AdvancedAccountInterface
public isCredentialsNonExpired ( ) : boolean
Résultat boolean true if the user's credentials are non expired, false otherwise

isEnabled() public méthode

Implements AdvancedAccountInterface
public isEnabled ( ) : boolean
Résultat boolean true if the user is enabled, false otherwise

isExpired() public méthode

public isExpired ( )

isLocked() public méthode

public isLocked ( )

isPasswordRequestNonExpired() public méthode

Checks whether the password reset request has expired.
public isPasswordRequestNonExpired ( integer $ttl ) : boolean
$ttl integer Requests older than this many seconds will be considered expired
Résultat boolean true if the users's password request is non expired, false otherwise

isSuperAdmin() public méthode

Tell if the the given user has the super admin role
public isSuperAdmin ( ) : boolean
Résultat boolean

isUser() public méthode

Tell if the the given user is this user Useful when not hydrating all fields.
public isUser ( FOS\UserBundle\Model\UserInterface $user = null ) : boolean
$user FOS\UserBundle\Model\UserInterface
Résultat boolean

removeGroup() public méthode

Remove a group from the user groups
public removeGroup ( FOS\UserBundle\Model\GroupInterface $group ) : null
$group FOS\UserBundle\Model\GroupInterface
Résultat null

removeRole() public méthode

public removeRole ( $role )

setAlgorithm() public méthode

public setAlgorithm ( $algorithm )

setConfirmationToken() public méthode

Set confirmationToken
public setConfirmationToken ( $confirmationToken ) : null
Résultat null

setCredentialsExpireAt() public méthode

public setCredentialsExpireAt ( DateTime $date )
$date DateTime

setCredentialsExpired() public méthode

public setCredentialsExpired ( $boolean )

setEmail() public méthode

Set email.
public setEmail ( string $email )
$email string

setEmailCanonical() public méthode

Set emailCanonical.
public setEmailCanonical ( string $emailCanonical )
$emailCanonical string

setEnabled() public méthode

public setEnabled ( boolean $boolean )
$boolean boolean

setExpired() public méthode

Sets this user to expired
public setExpired ( boolean $boolean ) : void
$boolean boolean
Résultat void

setExpiresAt() public méthode

public setExpiresAt ( DateTime $date )
$date DateTime

setLastLogin() public méthode

public setLastLogin ( DateTime $time )
$time DateTime

setLocked() public méthode

public setLocked ( $boolean )

setPassword() public méthode

Sets the hashed password.
public setPassword ( string $password ) : void
$password string
Résultat void

setPasswordRequestedAt() public méthode

Set the timestamp that the user requested a password reset.
public setPasswordRequestedAt ( DateTime $date )
$date DateTime

setPlainPassword() public méthode

public setPlainPassword ( $password )

setRoles() public méthode

public setRoles ( array $roles )
$roles array

setSuperAdmin() public méthode

Sets the super admin status
public setSuperAdmin ( boolean $boolean ) : void
$boolean boolean
Résultat void

setUsername() public méthode

Set username.
public setUsername ( string $username )
$username string

setUsernameCanonical() public méthode

Set usernameCanonical.
public setUsernameCanonical ( string $usernameCanonical )
$usernameCanonical string

Property Details

$algorithm protected_oe property

The algorithm to use for hashing
protected string $algorithm
Résultat string

$confirmationToken protected_oe property

Random string sent to the user email address in order to verify it
protected string $confirmationToken
Résultat string

$createdAt protected_oe property

protected DateTime $createdAt
Résultat DateTime

$credentialsExpireAt protected_oe property

protected DateTime $credentialsExpireAt
Résultat DateTime

$credentialsExpired protected_oe property

protected bool $credentialsExpired
Résultat boolean

$email protected_oe property

protected string $email
Résultat string

$emailCanonical protected_oe property

protected string $emailCanonical
Résultat string

$enabled protected_oe property

protected bool $enabled
Résultat boolean

$expired protected_oe property

protected bool $expired
Résultat boolean

$expiresAt protected_oe property

protected DateTime $expiresAt
Résultat DateTime

$groups protected_oe property

protected Collection,Doctrine\Common\Collections $groups
Résultat Doctrine\Common\Collections\Collection

$id protected_oe property

protected $id

$lastLogin protected_oe property

protected DateTime $lastLogin
Résultat DateTime

$locked protected_oe property

protected bool $locked
Résultat boolean

$password protected_oe property

Encrypted password. Must be persisted.
protected string $password
Résultat string

$passwordRequestedAt protected_oe property

protected DateTime $passwordRequestedAt
Résultat DateTime

$plainPassword protected_oe property

Plain password. Used for model validation. Must not be persisted.
protected string $plainPassword
Résultat string

$roles protected_oe property

protected array $roles
Résultat array

$salt protected_oe property

The salt to use for hashing
protected string $salt
Résultat string

$updatedAt protected_oe property

protected DateTime $updatedAt
Résultat DateTime

$username protected_oe property

protected string $username
Résultat string

$usernameCanonical protected_oe property

protected string $usernameCanonical
Résultat string