PHP Class SimpleSAML_Store_SQL, simplesamlphp

Inheritance: extends SimpleSAML_Store
Datei anzeigen Open project: simplesamlphp/simplesamlphp Class Usage Examples

Public Properties

Property Type Description
$driver string Our database driver.
$pdo PDO The PDO object for our database.
$prefix string The prefix we should use for our tables.

Public Methods

Method Description
delete ( string $type, string $key ) Delete an entry from the data store.
get ( string $type, string $key ) : mixed | null Retrieve a value from the data store.
getTableVersion ( string $name ) : integer Get table version.
insertOrUpdate ( string $table, array $keys, array $data ) Insert or update a key-value in the store.
set ( string $type, string $key, mixed $value, integer | null $expire = null ) Save a value in the data store.
setTableVersion ( string $name, integer $version ) Set table version.

Protected Methods

Method Description
__construct ( ) Initialize the SQL data store.

Private Methods

Method Description
cleanKVStore ( ) Clean the key-value table of expired entries.
initKVTable ( ) Initialize key-value table.
initTableVersionTable ( ) Initialize the table-version table.

Method Details

__construct() protected method

Initialize the SQL data store.
protected __construct ( )

delete() public method

Delete an entry from the data store.
public delete ( string $type, string $key )
$type string The type of the data
$key string The key to delete.

get() public method

Retrieve a value from the data store.
public get ( string $type, string $key ) : mixed | null
$type string The type of the data.
$key string The key to retrieve.
return mixed | null The value associated with that key, or null if there's no such key.

getTableVersion() public method

Get table version.
public getTableVersion ( string $name ) : integer
$name string Table name.
return integer The table version, or 0 if the table doesn't exist.

insertOrUpdate() public method

Since various databases implement different methods for doing this, we abstract it away here.
public insertOrUpdate ( string $table, array $keys, array $data )
$table string The table we should update.
$keys array The key columns.
$data array Associative array with columns.

set() public method

Save a value in the data store.
public set ( string $type, string $key, mixed $value, integer | null $expire = null )
$type string The type of the data.
$key string The key to insert.
$value mixed The value itself.
$expire integer | null The expiration time (unix timestamp), or null if it never expires.

setTableVersion() public method

Set table version.
public setTableVersion ( string $name, integer $version )
$name string Table name.
$version integer Table version.

Property Details

$driver public_oe property

Our database driver.
public string $driver
return string

$pdo public_oe property

The PDO object for our database.
public PDO $pdo
return PDO

$prefix public_oe property

The prefix we should use for our tables.
public string $prefix
return string