Méthode | Description | |
---|---|---|
applyPrefix ( string $table ) : string | This function simply applies the table prefix to a supplied table name. | |
getInstance ( SimpleSAML_Configuration $altConfig = null ) : |
Retrieves the current database instance. Will create a new one if there isn't an existing connection. | |
getLastError ( ) : array | Return an array with information about the last operation performed in the database. | |
read ( string $stmt, array $params = [] ) : PDOStatement | This executes queries on a database server that is determined by this::getSlave(). | |
write ( string $stmt, array $params = [] ) : integer | This executes queries directly on the master. |
Méthode | Description | |
---|---|---|
__construct ( SimpleSAML_Configuration $config ) | Private constructor that restricts instantiation to getInstance(). | |
connect ( string $dsn, string $username, string $password, array $options ) : PDO | This function connects to a database. | |
exec ( PDO $db, string $stmt ) : integer | This function queries the database without using a prepared statement. | |
generateInstanceId ( SimpleSAML_Configuration $config ) : string | Generate an Instance ID based on the database configuration. | |
getSlave ( ) : PDO | This function randomly selects a slave database server to query. In the event no slaves are configured, it will return the master. | |
query ( PDO $db, string $stmt, array $params ) : PDOStatement | This function queries the database |
public applyPrefix ( string $table ) : string | ||
$table | string | Table to apply prefix to, if configured |
Résultat | string | Table with configured prefix |
public static getInstance ( SimpleSAML_Configuration $altConfig = null ) : |
||
$altConfig | SimpleSAML_Configuration | Optional: Instance of a SimpleSAML_Configuration class |
Résultat | The shared database connection. |
public getLastError ( ) : array | ||
Résultat | array | The array with error information. |