\nre\driversMysqliDriver

Implementation of a database driver for MySQL-databases.

Summary

Methods
Properties
Constants
singleton()
__construct()
load()
factory()
query()
getInsertId()
setAutocommit()
rollback()
commit()
No public properties found
No constants found
connect()
$driver
$connection
N/A
getClassName()
No private properties found
N/A

Properties

$connection

$connection : resource

Connection resource

Type

resource

Methods

singleton()

singleton(array  $config) : \nre\drivers\DatabaseDriver

Singleton-pattern.

Parameters

array $config

Database driver configuration

Returns

\nre\drivers\DatabaseDriver

Singleton-instance of database driver class

__construct()

__construct(array  $config) 

Construct a MySQL-driver.

Parameters

array $config

Connection and login settings

Throws

\nre\exceptions\DatamodelException

load()

load(string  $driverName) 

Load the class of a Driver.

Parameters

string $driverName

Name of the Driver to load

Throws

\nre\exceptions\DriverNotFoundException
\nre\exceptions\DriverNotValidException

factory()

factory(string  $driverName, array  $config) 

Instantiate a Driver (Factory Pattern).

Parameters

string $driverName

Name of the Driver to instantiate

array $config

Configuration settings

query()

query(string  $query) : array

Execute a SQL-query.

Parameters

string $query

Query to run

Throws

\nre\exceptions\DatamodelException

Returns

array —

Result

getInsertId()

getInsertId() : integer

Return the last insert id (of the last insert-query).

Returns

integer —

Last insert id

setAutocommit()

setAutocommit(boolean  $autocommit) 

Enable/disable autocommit feature.

Parameters

boolean $autocommit

Enable/disable autocommit

rollback()

rollback() 

Rollback the current transaction.

commit()

commit() 

Commit the current transaction.

connect()

connect(array  $config) 

Establish a connect to a MqSQL-database.

Parameters

array $config

Connection and login settings

Throws

\nre\exceptions\DatamodelException

getClassName()

getClassName(string  $driverName) : string

Determine the classname for the given Driver name.

Parameters

string $driverName

Driver name to get classname of

Returns

string —

Classname fore the Driver name