class Account (View source)

An account model

Properties

protected string $accountIdentifier
protected string $authenticationProviderName
protected string $credentialsSource
protected DateTime $creationDate
protected DateTime $expirationDate
protected DateTime $lastSuccessfulAuthenticationDate
protected int $failedAuthenticationCount
protected array $roleIdentifiers
protected Role[] $roles
protected PolicyService $policyService
protected ObjectManagerInterface $objectManager
protected Now $now

Methods

__construct()

Upon creation the creationDate property is initialized.

void
initializeRoles()

Initializes the roles field by fetching the role objects referenced by the roleIdentifiers

string
getAccountIdentifier()

Returns the account identifier

void
setAccountIdentifier(string $accountIdentifier)

Set the account identifier

string
getAuthenticationProviderName()

Returns the authentication provider name this account corresponds to

void
setAuthenticationProviderName(string $authenticationProviderName)

Set the authentication provider name this account corresponds to

mixed
getCredentialsSource()

Returns the credentials source

void
setCredentialsSource(mixed $credentialsSource)

Sets the credentials source

Role[]
getRoles()

Returns the roles this account has assigned

void
setRoles(array $roles)

Sets the roles for this account

bool
hasRole(Role $role)

Return if the account has a certain role

void
addRole(Role $role)

Adds a role to this account

void
removeRole(Role $role)

Removes a role from this account

getCreationDate()

Returns the date on which this account has been created.

DateTime|null
getExpirationDate()

Returns the date on which this account has expired or will expire. If no expiration date has been set, NULL is returned.

void
setExpirationDate(DateTime $expirationDate = null)

Sets the date on which this account will become inactive

int
getFailedAuthenticationCount()

No description

void
authenticationAttempted(int $authenticationStatus)

Sets the authentication status. Usually called by the responsible \Neos\Flow\Security\Authentication\AuthenticationManagerInterface

bool
isActive()

Returns true if it is currently allowed to use this account for authentication.

Details

__construct()

Upon creation the creationDate property is initialized.

protected void initializeRoles()

Initializes the roles field by fetching the role objects referenced by the roleIdentifiers

Return Value

void

string getAccountIdentifier()

Returns the account identifier

Return Value

string

The account identifier

void setAccountIdentifier(string $accountIdentifier)

Set the account identifier

Parameters

string $accountIdentifier

The account identifier

Return Value

void

string getAuthenticationProviderName()

Returns the authentication provider name this account corresponds to

Return Value

string

The authentication provider name

void setAuthenticationProviderName(string $authenticationProviderName)

Set the authentication provider name this account corresponds to

Parameters

string $authenticationProviderName

The authentication provider name

Return Value

void

mixed getCredentialsSource()

Returns the credentials source

Return Value

mixed

The credentials source

void setCredentialsSource(mixed $credentialsSource)

Sets the credentials source

Parameters

mixed $credentialsSource

The credentials source

Return Value

void

Role[] getRoles()

Returns the roles this account has assigned

Return Value

Role[]

The assigned roles, indexed by role identifier

void setRoles(array $roles)

Sets the roles for this account

Parameters

array $roles

An array of Policy\Role objects

Return Value

void

Exceptions

InvalidArgumentException

bool hasRole(Role $role)

Return if the account has a certain role

Parameters

Role $role

Return Value

bool

void addRole(Role $role)

Adds a role to this account

Parameters

Role $role

Return Value

void

Exceptions

InvalidArgumentException

void removeRole(Role $role)

Removes a role from this account

Parameters

Role $role

Return Value

void

DateTime getCreationDate()

Returns the date on which this account has been created.

Return Value

DateTime

DateTime|null getExpirationDate()

Returns the date on which this account has expired or will expire. If no expiration date has been set, NULL is returned.

Return Value

DateTime|null

void setExpirationDate(DateTime $expirationDate = null)

Sets the date on which this account will become inactive

Parameters

DateTime $expirationDate

Return Value

void

int getFailedAuthenticationCount()

No description

Return Value

int

DateTime getLastSuccessfulAuthenticationDate()

No description

Return Value

DateTime

void authenticationAttempted(int $authenticationStatus)

Sets the authentication status. Usually called by the responsible \Neos\Flow\Security\Authentication\AuthenticationManagerInterface

Parameters

int $authenticationStatus

One of WRONG_CREDENTIALS, AUTHENTICATION_SUCCESSFUL

Return Value

void

Exceptions

InvalidAuthenticationStatusException

bool isActive()

Returns true if it is currently allowed to use this account for authentication.

Returns false if the account has expired.

Return Value

bool