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

public
__construct(string $memberID)

No description

public
bool
has(string $credentialId)

No description

public
AttestedCredentialData
get(string $credentialId)

No description

public
string
getUserHandleFor(string $credentialId)

No description

public
int
getCounterFor(string $credentialId)

No description

public
void
updateCounterFor(string $credentialId, int $newCounter)

No description

protected
void
assertCredentialID(string $credentialId)

Assert that the given credential ID matches a stored credential

public
PublicKeyCredentialSource|null
findOneByCredentialId(string $publicKeyCredentialId)

No description

public
array
findAllForUserEntity(PublicKeyCredentialUserEntity $publicKeyCredentialUserEntity)

No description

public
void
saveCredentialSource(PublicKeyCredentialSource $publicKeyCredentialSource)

No description

public
void
reset()

Empty the store deleting all stored credentials

public
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)

protected
void
setCredentials(array $credentials)

Set the credentials in bulk (for internal use) ensuring that credential objects are initialised correctly

protected
string
getCredentialIDRef(string $credentialID)

Create a reference to be used as a key for the credentials in the array

public
array
toArray()

Provide the credentials stored in this repository as an array

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

Create an instance of a repository from the given credentials

public
array
__serialize()

No description

public
void
__unserialize(array $data)

No description

public
string
serialize() deprecated

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

public
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)

No description

Parameters

string $memberID

bool has(string $credentialId)

No description

Parameters

string $credentialId

Return Value

bool

AttestedCredentialData get(string $credentialId)

No description

Parameters

string $credentialId

Return Value

AttestedCredentialData

string getUserHandleFor(string $credentialId)

No description

Parameters

string $credentialId

Return Value

string

int getCounterFor(string $credentialId)

No description

Parameters

string $credentialId

Return Value

int

void updateCounterFor(string $credentialId, int $newCounter)

No description

Parameters

string $credentialId
int $newCounter

Return Value

void

protected void assertCredentialID(string $credentialId)

Assert that the given credential ID matches a stored credential

Parameters

string $credentialId

Return Value

void

PublicKeyCredentialSource|null findOneByCredentialId(string $publicKeyCredentialId)

No description

Parameters

string $publicKeyCredentialId

Return Value

PublicKeyCredentialSource|null

array findAllForUserEntity(PublicKeyCredentialUserEntity $publicKeyCredentialUserEntity)

No description

Parameters

PublicKeyCredentialUserEntity $publicKeyCredentialUserEntity

Return Value

array

void saveCredentialSource(PublicKeyCredentialSource $publicKeyCredentialSource)

No description

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

protected void setCredentials(array $credentials)

Set the credentials in bulk (for internal use) ensuring that credential objects are initialised correctly

Parameters

array $credentials

Return Value

void

protected string getCredentialIDRef(string $credentialID)

Create a reference to be used as a key for the credentials in the array

Parameters

string $credentialID

Return Value

string

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()

No description

Return Value

array

void __unserialize(array $data)

No description

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