Statement
+ Inheritance diagram for Statement:

Description

Extends PDOStatement for fluency and logging.

Protected Properties

DB $db
 

Public Methods

$this __invoke (array $args=null)
 Fluent execution. More...
 
string __toString ()
 The query string. More...
 
bool execute ($args=null)
 Logs. More...
 
int getId ()
 lastInsertId() More...
 

Protected Methods

 __construct (DB $db)
 PDO requires this to be protected. More...
 

Constructor

◆ __construct()

__construct ( DB  $db)
protected

PDO requires this to be protected.

Parameters
DB$db

Methods

◆ __invoke()

$this __invoke ( array  $args = null)

Fluent execution.

Parameters
array$args
Returns
$this

◆ __toString()

string __toString ( )

The query string.

Returns
string

◆ execute()

bool execute (   $args = null)

Logs.

PHP returns false instead of throwing if too many arguments were given. This checks for that and throws.

Parameters
array$args
Returns
bool
Exceptions
ArgumentCountError

◆ getId()

int getId ( )

lastInsertId()

Returns
int