PHP Interface Symfony\Component\Security\Authentication\Token\TokenInterface

Author: Fabien Potencier ([email protected])
Inheritance: extends Serializable
显示文件 Open project: pmjones/php-framework-benchmarks Interface Usage Examples

Public Methods

Method Description
__toString ( ) : string Returns a string representation of the token.
eraseCredentials ( ) Removes sensitive information from the token.
getCredentials ( ) : mixed Returns the user credentials.
getRoles ( ) : Role[] Returns the user roles.
getUser ( ) : object Returns a user instance.
isAuthenticated ( ) : boolean Checks if the user is authenticated or not.
isImmutable ( ) : boolean Checks whether the token is immutable or not.
setAuthenticated ( boolean $isAuthenticated ) Sets the authenticated flag.

Method Details

__toString() public method

Returns a string representation of the token.
public __toString ( ) : string
return string A string representation

eraseCredentials() public method

Removes sensitive information from the token.
public eraseCredentials ( )

getCredentials() public method

Returns the user credentials.
public getCredentials ( ) : mixed
return mixed The user credentials

getRoles() public method

Returns the user roles.
public getRoles ( ) : Role[]
return Role[] An array of Role instances.

getUser() public method

Returns a user instance.
public getUser ( ) : object
return object The User instance

isAuthenticated() public method

Checks if the user is authenticated or not.
public isAuthenticated ( ) : boolean
return boolean true if the token has been authenticated, false otherwise

isImmutable() public method

Checks whether the token is immutable or not.
public isImmutable ( ) : boolean
return boolean true if the token is immutable, false otherwise

setAuthenticated() public method

Sets the authenticated flag.
public setAuthenticated ( boolean $isAuthenticated )
$isAuthenticated boolean The authenticated flag