\Gishiki\Database\Adapters\UtilsPDODatabaseTrait

Represent a generic relational database.

This class is not meant to be used by the user as it contains standard code each database class would use when using the PHP PDo driver.

Summary

Methods
Properties
Constants
__construct()
connect()
close()
connected()
createTable()
create()
update()
delete()
deleteAll()
read()
readSelective()
No public properties found
No constants found
executeQuery()
$connected
$connection
N/A
No private methods found
No private properties found
N/A

Properties

$connected

$connected : boolean

Type

boolean — TRUE only if the connection is alive

$connection

$connection : \PDO

Type

\PDO — the native pdo connection

Methods

__construct()

__construct(string  $details) 

Create a new database connection using the given connection string.

The connect function is automatically called.

Parameters

string $details

the connection string

connect()

connect(  $details) 

Parameters

$details

close()

close() 

connected()

connected() 

create()

create(  $collection,   $data) 

Parameters

$collection
$data

deleteAll()

deleteAll(  $collection) 

Parameters

$collection

executeQuery()

executeQuery(\Gishiki\Database\Adapters\Utils\SQLGenerator\SQLWrapperInterface  $queryBuilder) : \PDOStatement

Create the query from the given query builder, execute it and return the execution statement.

Parameters

\Gishiki\Database\Adapters\Utils\SQLGenerator\SQLWrapperInterface $queryBuilder

the loaded query builder

Returns

\PDOStatement —

the statement after query execution