class CredentialRepository implements PublicKeyCredentialSourceRepository, Serializable (View source)

Implements the required interface from the WebAuthn library - but it does not implement the repository pattern in the usual way. This is expected to be stored on a DataObject for persistence. Use the

Methods

__construct(string $memberID)

No description

bool
has(string $credentialId)

No description

AttestedCredentialData
get(string $credentialId)

No description

string
getUserHandleFor(string $credentialId)

No description

int
getCounterFor(string $credentialId)

No description

void
updateCounterFor(string $credentialId, int $newCounter)

No description

PublicKeyCredentialSource|null
findOneByCredentialId(string $publicKeyCredentialId)

No description

array
findAllForUserEntity(PublicKeyCredentialUserEntity $publicKeyCredentialUserEntity)

No description

void
saveCredentialSource(PublicKeyCredentialSource $publicKeyCredentialSource)

No description

void
reset()

Empty the store deleting all stored credentials

bool
hasChanged()

Indicates the repository has changed and should be persisted (as this doesn't follow the actual repository pattern and is expected to be stored on a dataobject for persistence)

array
toArray()

Provide the credentials stored in this repository as an array

fromArray(array $credentials, string $memberID)

Create an instance of a repository from the given credentials

array
__serialize()

No description

void
__unserialize(array $data)

No description

string
serialize() deprecated

The __serialize() magic method will be automatically used instead of this

unserialize(string $serialized) deprecated

The __unserialize() magic method will be automatically used instead of this almost all the time This method will be automatically used if existing serialized data was not saved as an associative array and the PHP version used in less than PHP 9.0

Details

__construct(string $memberID)

Parameters

string $memberID

bool has(string $credentialId)

Parameters

string $credentialId

Return Value

bool

AttestedCredentialData get(string $credentialId)

Parameters

string $credentialId

Return Value

AttestedCredentialData

string getUserHandleFor(string $credentialId)

Parameters

string $credentialId

Return Value

string

int getCounterFor(string $credentialId)

Parameters

string $credentialId

Return Value

int

void updateCounterFor(string $credentialId, int $newCounter)

Parameters

string $credentialId
int $newCounter

Return Value

void

PublicKeyCredentialSource|null findOneByCredentialId(string $publicKeyCredentialId)

Parameters

string $publicKeyCredentialId

Return Value

PublicKeyCredentialSource|null

array findAllForUserEntity(PublicKeyCredentialUserEntity $publicKeyCredentialUserEntity)

Parameters

PublicKeyCredentialUserEntity $publicKeyCredentialUserEntity

Return Value

array

void saveCredentialSource(PublicKeyCredentialSource $publicKeyCredentialSource)

Parameters

PublicKeyCredentialSource $publicKeyCredentialSource

Return Value

void

void reset()

Empty the store deleting all stored credentials

Return Value

void

bool hasChanged()

Indicates the repository has changed and should be persisted (as this doesn't follow the actual repository pattern and is expected to be stored on a dataobject for persistence)

Return Value

bool

array toArray()

Provide the credentials stored in this repository as an array

Return Value

array

static CredentialRepository fromArray(array $credentials, string $memberID)

Create an instance of a repository from the given credentials

Parameters

array $credentials
string $memberID

Return Value

CredentialRepository

array __serialize()

Return Value

array

void __unserialize(array $data)

Parameters

array $data

Return Value

void

string serialize() deprecated

deprecated 4.5.0 Use __serialize() instead

The __serialize() magic method will be automatically used instead of this

Return Value

string

unserialize(string $serialized) deprecated

deprecated 4.5.0 Use __unserialize() instead

The __unserialize() magic method will be automatically used instead of this almost all the time This method will be automatically used if existing serialized data was not saved as an associative array and the PHP version used in less than PHP 9.0

Parameters

string $serialized