# \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

File
  drivers/MysqliDriver.inc
Package
  Default
Class hierarchy
  \nre\core\Driver
  \nre\drivers\DatabaseDriver
  \nre\drivers\MysqliDriver

## Tags

author | coderkun olli@coderkun.de

## Properties

### $driver

    $driver : \nre\drivers\DatabaseDriver

Driver class instance

#### Type

\nre\drivers\DatabaseDriver

#

Inherited from
  \nre\drivers\DatabaseDriver

## Tags

static |

### $connection

    $connection : resource

Connection resource

#### Type

resource

#

Inherited from
  \nre\drivers\DatabaseDriver

## Tags

None found

## 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

#

static

Inherited from
  \nre\drivers\DatabaseDriver

## Tags

None found

### __construct()

    __construct(array  $config)

Construct a MySQL-driver.

#### Parameters

array | $config | Connection and login settings

#### Throws

\nre\exceptions\DatamodelException

#

## Tags

None found

### 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

#

static

Inherited from
  \nre\core\Driver

## Tags

None found

### factory()

    factory(string  $driverName, array  $config)

Instantiate a Driver (Factory Pattern).

#### Parameters

string | $driverName | Name of the Driver to instantiate
array | $config | Configuration settings

#

static

Inherited from
  \nre\core\Driver

## Tags

None found

### query()

    query(string  $query) : array

Execute a SQL-query.

#### Parameters

string | $query | Query to run

#### Throws

\nre\exceptions\DatamodelException

#### Returns

array —

Result

#

## Tags

None found

### getInsertId()

    getInsertId() : integer

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

#### Returns

integer —

Last insert id

#

## Tags

None found

### setAutocommit()

    setAutocommit(boolean  $autocommit)

Enable/disable autocommit feature.

#### Parameters

boolean | $autocommit | Enable/disable autocommit

#

## Tags

None found

### rollback()

    rollback()

Rollback the current transaction.

#

## Tags

None found

### commit()

    commit()

Commit the current transaction.

#

## Tags

None found

### connect()

    connect(array  $config)

Establish a connect to a MqSQL-database.

#### Parameters

array | $config | Connection and login settings

#### Throws

\nre\exceptions\DatamodelException

#

## Tags

None found

### 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

#

static

Inherited from
  \nre\core\Driver

## Tags

None found

### MysqliDriver.inc