MfaProviderPropertyManager implements LoggerAwareInterface uses LoggerAwareTrait
Basic manager for MFA providers to access and update their properties (information) from the mfa column in the user array.
Table of Contents
Interfaces
- LoggerAwareInterface
Constants
- DATABASE_FIELD_NAME = 'mfa'
Properties
- $mfa : array<string|int, mixed>
- $providerIdentifier : string
- $providerProperties : array<string|int, mixed>
- $user : AbstractUserAuthentication
Methods
- __construct() : mixed
- create() : self
- Create property manager for the user with the given provider
- createProviderEntry() : bool
- Create a new provider entry for the current user Note: If an entry already exists, use updateProperties() instead.
- deleteProviderEntry() : bool
- Delete a provider entry for the current user
- getIdentifier() : string
- Return the current providers identifier
- getProperties() : array<string|int, mixed>
- Get provider specific properties
- getProperty() : mixed
- Get a provider specific property value or the defined default value if the requested property was not found.
- getUser() : AbstractUserAuthentication
- Return the current user
- hasProperty() : bool
- Check if a provider property exists
- hasProviderEntry() : bool
- Check if a provider entry exists for the current user
- updateProperties() : bool
- Update the provider properties Note: If no entry exists yet, use createProviderEntry() instead.
- storeProperties() : bool
- Stores the updated properties in the user array and the database
Constants
DATABASE_FIELD_NAME
protected
mixed
DATABASE_FIELD_NAME
= 'mfa'
Properties
$mfa
protected
array<string|int, mixed>
$mfa
$providerIdentifier read-only
protected
string
$providerIdentifier
$providerProperties
protected
array<string|int, mixed>
$providerProperties
$user read-only
protected
AbstractUserAuthentication
$user
Methods
__construct()
public
__construct(AbstractUserAuthentication $user, string $providerIdentifier) : mixed
Parameters
- $user : AbstractUserAuthentication
- $providerIdentifier : string
create()
Create property manager for the user with the given provider
public
static create(MfaProviderManifestInterface $provider, AbstractUserAuthentication $user) : self
Parameters
- $provider : MfaProviderManifestInterface
- $user : AbstractUserAuthentication
Return values
selfcreateProviderEntry()
Create a new provider entry for the current user Note: If an entry already exists, use updateProperties() instead.
public
createProviderEntry(array<string|int, mixed> $properties) : bool
This can be checked with hasProviderEntry().
Parameters
- $properties : array<string|int, mixed>
Return values
booldeleteProviderEntry()
Delete a provider entry for the current user
public
deleteProviderEntry() : bool
Tags
Return values
boolgetIdentifier()
Return the current providers identifier
public
getIdentifier() : string
Return values
stringgetProperties()
Get provider specific properties
public
getProperties() : array<string|int, mixed>
Return values
array<string|int, mixed>getProperty()
Get a provider specific property value or the defined default value if the requested property was not found.
public
getProperty(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
getUser()
Return the current user
public
getUser() : AbstractUserAuthentication
Return values
AbstractUserAuthenticationhasProperty()
Check if a provider property exists
public
hasProperty(string $key) : bool
Parameters
- $key : string
Return values
boolhasProviderEntry()
Check if a provider entry exists for the current user
public
hasProviderEntry() : bool
Return values
boolupdateProperties()
Update the provider properties Note: If no entry exists yet, use createProviderEntry() instead.
public
updateProperties(array<string|int, mixed> $properties) : bool
This can be checked with hasProviderEntry().
Parameters
- $properties : array<string|int, mixed>
Return values
boolstoreProperties()
Stores the updated properties in the user array and the database
protected
storeProperties() : bool