PHP Class Symfony\Component\Security\Core\Authentication\Token\AbstractToken

Author: Fabien Potencier ([email protected])
Author: Johannes M. Schmitt ([email protected])
Inheritance: implements Symfony\Component\Security\Core\Authentication\Token\TokenInterface
Datei anzeigen Open project: symfony/symfony Class Usage Examples

Public Methods

Method Description
__construct ( array $roles = [] ) Constructor.
__toString ( )
eraseCredentials ( )
getAttribute ( string $name ) : mixed Returns an attribute value.
getAttributes ( ) : array Returns the token attributes.
getRoles ( )
getUser ( )
getUsername ( )
hasAttribute ( string $name ) : boolean Returns true if the attribute exists.
isAuthenticated ( )
serialize ( )
setAttribute ( string $name, mixed $value ) Sets an attribute.
setAttributes ( array $attributes ) Sets the token attributes.
setAuthenticated ( $authenticated )
setUser ( string | object $user ) Sets the user in the token.
unserialize ( $serialized )

Private Methods

Method Description
hasUserChanged ( Symfony\Component\Security\Core\User\UserInterface $user )

Method Details

__construct() public method

Constructor.
public __construct ( array $roles = [] )
$roles array

__toString() public method

public __toString ( )

eraseCredentials() public method

public eraseCredentials ( )

getAttribute() public method

Returns an attribute value.
public getAttribute ( string $name ) : mixed
$name string The attribute name
return mixed The attribute value

getAttributes() public method

Returns the token attributes.
public getAttributes ( ) : array
return array The token attributes

getRoles() public method

public getRoles ( )

getUser() public method

public getUser ( )

getUsername() public method

public getUsername ( )

hasAttribute() public method

Returns true if the attribute exists.
public hasAttribute ( string $name ) : boolean
$name string The attribute name
return boolean true if the attribute exists, false otherwise

isAuthenticated() public method

public isAuthenticated ( )

serialize() public method

public serialize ( )

setAttribute() public method

Sets an attribute.
public setAttribute ( string $name, mixed $value )
$name string The attribute name
$value mixed The attribute value

setAttributes() public method

Sets the token attributes.
public setAttributes ( array $attributes )
$attributes array The token attributes

setAuthenticated() public method

public setAuthenticated ( $authenticated )

setUser() public method

The user can be a UserInterface instance, or an object implementing a __toString method or the username as a regular string.
public setUser ( string | object $user )
$user string | object The user

unserialize() public method

public unserialize ( $serialized )