PDOAdapter Class
Aurora\Database\Adapter Namespace
Interfaces
Properties
dsn
DSN
protected $dsn: string
dbh
Database handle
protected $dbh: \PDO
logger
Logger implementation
protected $logger: \LoggerInterface
options
Options array
protected $options: array
Constructor
__construct
Constructor
Parameters
array
$options
— Connection options array
Signature
public function __construct(array $options)
Methods
__construct
Constructor
Parameters
-
array
$options
— Connection options array
Signature
public function __construct(array $options)
connect
Connect adapter
Return Value
bool
Signature
public function connect(): bool
setLogger
Set LoggerInterface implementation
Parameters
-
Psr\Log\LoggerInterface
$logger
— LoggerInterface implementation
Signature
public function setLogger(Psr\Log\LoggerInterface $logger)
query
Execute a query
Parameters
-
string
$query
— Query string -
array
$parameters
— Array of parameters -
Closure
$callback
— Optional callback
Return Value
mixed
Signature
public function query(string $query, array $parameters = [], Closure $callback)
begin
Begin transaction
Return Value
$this
Signature
public function begin()
commit
Commit transaction
Return Value
$this
Signature
public function commit()
rollback
Rollback transaction
Return Value
$this
Signature
public function rollback()
lastInsertId
Get the last inserted ID
Return Value
int
Signature
public function lastInsertId(): int
isConnected
Check if there is an active connection
Return Value
bool
Signature
public function isConnected(): bool