Connection
Connection
Database Connection Interface Borrowed in part from Illuminate\Database\ConnectionInterface
- Full name: \Gibbon\Contracts\Database\Connection
Methods
- getConnection — Get the current PDO connection.
- selectOne — Run a select statement and return a single result.
- select — Run a select statement against the database.
- insert — Run an insert statement and return the last insert ID.
- update — Run an update statement against the database.
- delete — Run a delete statement against the database.
- statement — Execute an SQL statement and return the boolean result.
- affectingStatement — Run an SQL statement and get the number of rows affected.
- executeQuery
getConnection
Get the current PDO connection.
Connection::getConnection( ): \PDO
Return Value:
\PDO
selectOne
Run a select statement and return a single result.
Connection::selectOne( string $query, array $bindings = array() ): mixed
Return Value:
mixed
select
Run a select statement against the database.
Connection::select( string $query, array $bindings = array() ): array
Return Value:
array
insert
Run an insert statement and return the last insert ID.
Connection::insert( string $query, array $bindings = array() ): integer
Return Value:
integer
update
Run an update statement against the database.
Connection::update( string $query, array $bindings = array() ): integer
Return Value:
integer
delete
Run a delete statement against the database.
Connection::delete( string $query, array $bindings = array() ): integer
Return Value:
integer
statement
Execute an SQL statement and return the boolean result.
Connection::statement( string $query, array $bindings = array() ): boolean
Return Value:
boolean
affectingStatement
Run an SQL statement and get the number of rows affected.
Connection::affectingStatement( string $query, array $bindings = array() ): integer
Return Value:
integer
executeQuery
Connection::executeQuery( array $bindings = array(), string $query ): boolean
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
Return Value:
boolean