PHP Класс SimpleSAML_Store_SQL, simplesamlphp

Наследование: extends SimpleSAML_Store
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$driver string Our database driver.
$pdo PDO The PDO object for our database.
$prefix string The prefix we should use for our tables.

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
__construct ( ) Initialize the SQL data store.

Приватные методы

Метод Описание
cleanKVStore ( ) Clean the key-value table of expired entries.
initKVTable ( ) Initialize key-value table.
initTableVersionTable ( ) Initialize the table-version table.

Описание методов

__construct() защищенный Метод

Initialize the SQL data store.
protected __construct ( )

delete() публичный Метод

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() публичный Метод

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.
Результат mixed | null The value associated with that key, or null if there's no such key.

getTableVersion() публичный Метод

Get table version.
public getTableVersion ( string $name ) : integer
$name string Table name.
Результат integer The table version, or 0 if the table doesn't exist.

insertOrUpdate() публичный Метод

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() публичный Метод

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() публичный Метод

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

Описание свойств

$driver публичное свойство

Our database driver.
public string $driver
Результат string

$pdo публичное свойство

The PDO object for our database.
public PDO $pdo
Результат PDO

$prefix публичное свойство

The prefix we should use for our tables.
public string $prefix
Результат string