class UserSecurityIdentity implements SecurityIdentityInterface

A SecurityIdentity implementation used for actual users

Methods

__construct(string $username, string $class)

Constructor

fromAccount(UserInterface $user)

Creates a user security identity from a UserInterface

fromToken(TokenInterface $token)

Creates a user security identity from a TokenInterface

string
getUsername()

Returns the username

string
getClass()

Returns the user's class name

equals(SecurityIdentityInterface $sid)

This method is used to compare two security identities in order to not rely on referential equality.

string
__toString()

A textual representation of this security identity.

Details

at line line 37
__construct(string $username, string $class)

Constructor

Parameters

string $username the username representation
string $class the user's fully qualified class name

Exceptions

InvalidArgumentException

at line line 56
static UserSecurityIdentity fromAccount(UserInterface $user)

Creates a user security identity from a UserInterface

Parameters

UserInterface $user

Return Value

UserSecurityIdentity

at line line 67
static UserSecurityIdentity fromToken(TokenInterface $token)

Creates a user security identity from a TokenInterface

Parameters

TokenInterface $token

Return Value

UserSecurityIdentity

at line line 83
string getUsername()

Returns the username

Return Value

string

at line line 93
string getClass()

Returns the user's class name

Return Value

string

at line line 101
equals(SecurityIdentityInterface $sid)

This method is used to compare two security identities in order to not rely on referential equality.

Parameters

SecurityIdentityInterface $sid

at line line 118
string __toString()

A textual representation of this security identity.

This is not used for equality comparison, but only for debugging.

Return Value

string