PublicKeyCredentialSourceRepositoryMySql
        
        extends PublicKeyCredentialSourceRepositoryBase
    
    
            
            in package
            
        
    
    
    
        
            Credential repository that uses a given PDO for data access.
Table of Contents
- $pdo : PDO
- __construct() : mixed
- Constructor
- checkSchema() : void
- Checks if the schema needs to be updated.
- createInitialSchema() : void
- Creates the initial schema.
- deleteDevice() : bool
- Deletes a single device from the database.
- export() : array<string|int, array<string, mixed>>
- Exports all entries.
- findAllForUserDn() : array<string|int, PublicKeyCredentialSource>
- Finds all credential entries for the given user.
- findOneByCredentialId() : PublicKeyCredentialSource|null
- Finds the public key for the given credential id.
- getAllUserDevices() : array<string|int, array<string, mixed>>
- Performs a full-text search on the usernames and returns all devices found.
- hasRegisteredCredentials() : bool
- Returns if there are any credentials in the database.
- import() : void
- Imports entries from export data.
- saveCredentialSource() : void
- Saves the given credential in the database.
- searchDevices() : array<string|int, array<string, mixed>>
- Performs a full-text search on the usernames and returns all devices found.
- updateDeviceName() : bool
- Updates the device name.
- addNameColumn() : void
- Adds the name column if not existing.
- addUserDnColumn() : void
- Adds the user DN column if not existing.
- getPDO() : PDO
- Returns the PDO.
- getTableName() : string
- Returns the table name to use.
Properties
$pdo
    private
        PDO
    $pdo
    
    
    
    
Methods
__construct()
Constructor
    public
                    __construct(PDO $pdo) : mixed
    
        Parameters
- $pdo : PDO
- 
                    PDO 
Return values
mixed —checkSchema()
Checks if the schema needs to be updated.
    public
                    checkSchema() : void
    
    
    
        Return values
void —createInitialSchema()
Creates the initial schema.
    public
                    createInitialSchema(PDO $pdo) : void
    
        Parameters
- $pdo : PDO
- 
                    PDO object 
Return values
void —deleteDevice()
Deletes a single device from the database.
    public
                    deleteDevice(string $dn, string $credentialId) : bool
    
        Parameters
- $dn : string
- 
                    user DN 
- $credentialId : string
- 
                    credential id 
Return values
bool —deletion was ok
export()
Exports all entries.
    public
                    export() : array<string|int, array<string, mixed>>
    
    
    
        Return values
array<string|int, array<string, mixed>> —data
findAllForUserDn()
Finds all credential entries for the given user.
    public
                    findAllForUserDn(string $userDn) : array<string|int, PublicKeyCredentialSource>
    
        Parameters
- $userDn : string
- 
                    user DN 
Return values
array<string|int, PublicKeyCredentialSource> —credential sources
findOneByCredentialId()
Finds the public key for the given credential id.
    public
                    findOneByCredentialId(string $publicKeyCredentialId) : PublicKeyCredentialSource|null
    
        Parameters
- $publicKeyCredentialId : string
- 
                    credential id 
Return values
PublicKeyCredentialSource|null —credential source
getAllUserDevices()
Performs a full-text search on the usernames and returns all devices found.
    public
                    getAllUserDevices(string $userDn) : array<string|int, array<string, mixed>>
    
        Parameters
- $userDn : string
- 
                    user DN 
Return values
array<string|int, array<string, mixed>> —list of devices array('dn' => ..., 'credentialId' => ..., 'lastUseTime' => ..., 'registrationTime' => ...)
hasRegisteredCredentials()
Returns if there are any credentials in the database.
    public
                    hasRegisteredCredentials() : bool
    
    
    
        Return values
bool —at least one credential in the database
import()
Imports entries from export data.
    public
                    import(null|array<string|int, array<string, mixed>> $data) : void
    
        Parameters
- $data : null|array<string|int, array<string, mixed>>
- 
                    export data 
Return values
void —saveCredentialSource()
Saves the given credential in the database.
    public
                    saveCredentialSource(PublicKeyCredentialSource $publicKeyCredentialSource) : void
    
        Parameters
- $publicKeyCredentialSource : PublicKeyCredentialSource
- 
                    credential 
Return values
void —searchDevices()
Performs a full-text search on the usernames and returns all devices found.
    public
                    searchDevices(string $searchTerm) : array<string|int, array<string, mixed>>
    
        Parameters
- $searchTerm : string
- 
                    search term for user field 
Return values
array<string|int, array<string, mixed>> —list of devices array('dn' => ..., 'credentialId' => ..., 'lastUseTime' => ..., 'registrationTime' => ...)
updateDeviceName()
Updates the device name.
    public
                    updateDeviceName(string $dn, string $credentialId, string $name) : bool
    
        Parameters
- $dn : string
- 
                    user DN 
- $credentialId : string
- 
                    credential id 
- $name : string
- 
                    new name 
Return values
bool —success
addNameColumn()
Adds the name column if not existing.
    protected
                    addNameColumn(PDO $pdo) : void
    
        Parameters
- $pdo : PDO
- 
                    PDO 
Return values
void —addUserDnColumn()
Adds the user DN column if not existing.
    protected
                    addUserDnColumn(PDO $pdo) : void
    
        Parameters
- $pdo : PDO
- 
                    PDO 
Return values
void —getPDO()
Returns the PDO.
    protected
                    getPDO() : PDO
    
    
    
    Tags
Return values
PDO —PDO
getTableName()
Returns the table name to use.
    protected
                    getTableName() : string
    
    
    
    Tags
Return values
string —table name