\coreDBConnection

This class is a singleton for establishing a connection to the database

Summary

Methods
Properties
Constants
handle()
__clone()
isReadOnly()
exec()
lastID()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

handle()

handle( database) : \core\DBConnection

This is the actual constructor for the singleton. It creates a database connection if it is not up yet, and returns a handle to the database connection on every call.

Parameters

database

Returns

\core\DBConnection —

the (only) instance of this class

__clone()

__clone() : 

Implemented for safety reasons only. Cloning is forbidden and will tell the user so.

Returns

isReadOnly()

isReadOnly() : 

tells the caller if the database is to be accessed read-only

Returns

exec()

exec(  querystring,  types = NULL,  arguments) : 

executes a query and triggers logging to the SQL audit log if it's not a SELECT

Parameters

querystring

the query to be executed

types
arguments

Returns

the query result as mysqli_result object; or TRUE on non-return-value statements

lastID()

lastID() : 

Retrieves the last auto-id of an INSERT. Needs to be called immediately after the corresponding exec() call

Returns

the last autoincrement-ID