Метод |
Описание |
|
ConnectionFactory ( string $connect_string ) : mixed |
Returns the appropriate type of Connection class for the connect string passed or null on failure |
|
add_error ( array $error ) |
Adds an error to the internal collection |
|
begin_transaction ( ) |
Start a transaction against the RDBMS in order to wrap multiple
statements in a safe ACID-compliant container |
|
clear_errors ( ) |
Updates the last error pointer to simulate resetting the error array |
|
commit ( ) |
Commit a currently running transaction |
|
connect ( string $connect_string, string $db_user, string $db_pass ) : boolean |
Connect to a database server |
|
dbdelta ( $queries, $execute = true, $silent = true ) |
Automatic diffing function, used for determining required database upgrades. |
|
delete ( string $table, array $keyfields ) : boolean |
Deletes any record that matches the specific criteria |
|
disconnect ( ) : boolean |
Disconnect from the database server. |
|
exec ( string $query ) : boolean |
Execute the given query on the database. Encapsulates PDO::exec. |
|
execute_procedure ( string $procedure, array $args = [] ) : mixed |
Execute a stored procedure |
|
exists ( string $table, array $keyfieldvalues ) : boolean |
Checks for a record that matches the specific criteria |
|
filter_tables ( string $query ) : string |
Replace braced table names with their prefixed counterparts |
|
get_column ( string $query, array $args = [] ) : array |
Returns all values for a column for a query |
|
get_driver_name ( ) |
|
|
get_driver_version ( ) |
|
|
get_errors ( ) : array |
Returns error data gathered from database connection |
|
get_keyvalue ( string $query, array $args = [] ) : array |
Returns an associative array using the first returned column as the array key and the second as the array value |
|
get_last_error ( ) : array |
Returns only the last error info |
|
get_profiles ( ) : array |
Returns query profiles |
|
get_results ( string $query, array $args = [], string $class_name = '\Habari\QueryRecord' ) : array |
Execute a query and return the results as an array of objects |
|
get_row ( string $query, array $args = [], string $class_name = '\Habari\QueryRecord' ) : object |
Returns a single row (the first in a multi-result set) object for a query |
|
get_value ( string $query, array $args = [] ) : mixed |
Return a single value from the database |
|
has_errors ( ) : boolean |
Determines if there have been errors since the last clear_errors() call |
|
in_transaction ( ) : boolean |
Check whether there is a transaction underway. |
|
insert ( string $table, array $fieldvalues ) : boolean |
Inserts into the specified table values associated to the key fields |
|
is_connected ( ) : boolean |
Check whether there is an existing connection to a database. |
|
last_insert_id ( ) : mixed |
Helper function to return the last inserted sequence or
auto_increment field. Useful when doing multiple inserts
within a single transaction -- for example, adding dependent
related rows. |
|
list_tables ( ) : array |
Returns a list of tables the DB currently knows about. |
|
query ( string $query, array $args = [] ) : boolean |
Execute a SQL statement. |
|
query_file ( string $file ) : boolean |
Load a file containing queries, replace the prefix, execute all queries present |
|
quote ( string $string ) : string |
Return a PDO-quoted string appropriate for the DB backend we're using. |
|
register_table ( string $name ) |
Adds a table to the list of tables known to Habari. Used
by Theme and Plugin classes to inform the DB class about
custom tables used by the plugin |
|
rollback ( ) |
Rolls a currently running transaction back to the
prexisting state, or, if the RDBMS supports it, whenever
a savepoint was committed. |
|
row_count ( ) : integer |
Returns number of rows affected by the last DELETE, INSERT, or UPDATE |
|
set_fetch_class ( string $class_name ) |
Sets the class to fetch, if fetch mode is PDO::FETCH_CLASS |
|
set_fetch_mode ( integer $mode ) |
Sets the fetch mode for return calls from PDOStatement |
|
sql_t ( string $query, array &$args ) : string |
Translates the query for the current database engine |
|
table ( string $name ) : string |
Get the full table name for the given table. |
|
update ( string $table, array $fieldvalues, array $keyfields ) : boolean |
function update
Updates any record that matches the specific criteria
A new row is inserted if no existing record matches the criteria |
|
upgrade ( integer $old_version, string $upgrade_path = '' ) : boolean |
Updates the content of the database between versions. |
|
upgrade_post ( $old_version ) |
|
|
upgrade_pre ( $old_version ) |
|
|