\SeedDMS_Core_DatabaseAccess

Class to represent the database access for the document management

Summary

Methods
Properties
Constants
TableList()
SeedDMS_Core_DatabaseAccess()
connect()
ensureConnected()
qstr()
getResultArray()
getResult()
getInsertID()
startTransaction()
rollbackTransaction()
commitTransaction()
getErrorMsg()
getErrorNo()
createTemporaryTable()
$_debug
$_driver
$_hostname
$_database
$_user
$_passw
$_conn
$_connected
$_ttreviewid
$_ttapproveid
$_ttstatid
$_ttcontentid
$_intransaction
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$_debug

$_debug

$_driver

$_driver

$_hostname

$_hostname

$_database

$_database

$_user

$_user

$_passw

$_passw

$_conn

$_conn

$_connected

$_connected

$_ttreviewid

$_ttreviewid

$_ttapproveid

$_ttapproveid

$_ttstatid

$_ttstatid

$_ttcontentid

$_ttcontentid

$_intransaction

$_intransaction

Methods

TableList()

TableList() : array

Return list of all database tables

This function is used to retrieve a list of database tables for backup

Returns

array —

list of table names

SeedDMS_Core_DatabaseAccess()

SeedDMS_Core_DatabaseAccess(string $driver, string $hostname, string $user, string $passw, string $database)

Constructor of SeedDMS_Core_DatabaseAccess

Sets all database parameters but does not connect.

Parameters

string $driver

the database type e.g. mysql, sqlite

string $hostname

host of database server

string $user

name of user having access to database

string $passw

password of user

string $database

name of database

connect()

connect() : boolean

Connect to database

Returns

boolean —

true if connection could be established, otherwise false

ensureConnected()

ensureConnected() : boolean

Make sure a database connection exisits

This function checks for a database connection. If it does not exists it will reconnect.

Returns

boolean —

true if connection is established, otherwise false

qstr()

qstr( $text) : string

Sanitize String used in database operations

Parameters

$text

Returns

string —

sanitized string

getResultArray()

getResultArray(string $queryStr) : \array/boolean

Execute SQL query and return result

Call this function only with sql query which return data records.

Parameters

string $queryStr

sql query

Returns

\array/boolean —

data if query could be executed otherwise false

getResult()

getResult(string $queryStr, boolean $silent) : boolean

Execute SQL query

Call this function only with sql query which do not return data records.

Parameters

string $queryStr

sql query

boolean $silent

not used anymore. This was used when this method

   still issued an error message

Returns

boolean —

true if query could be executed otherwise false

getInsertID()

getInsertID() : integer

Return the id of the last instert record

Returns

integer —

id used in last autoincrement

startTransaction()

startTransaction()

rollbackTransaction()

rollbackTransaction()

commitTransaction()

commitTransaction()

getErrorMsg()

getErrorMsg()

getErrorNo()

getErrorNo()

createTemporaryTable()

createTemporaryTable( $tableName,  $override)

Create various temporary tables to speed up and simplify sql queries

Parameters

$tableName
$override