Méthode |
Description |
|
__construct ( PDO $pdo, string $dbEngine = '' ) |
Dependency-Injectable constructor |
|
beginTransaction ( ) : boolean |
Initiates a transaction |
|
cell ( string $statement, $params ) : mixed |
Variadic version of $this->single() |
|
col ( string $statement, integer $offset, $params ) : mixed |
Variadic version of $this->column() |
|
column ( string $statement, array $params = [], integer $offset ) : mixed |
Fetch a column |
|
commit ( ) : boolean |
Commits a transaction |
|
delete ( string $table, array $conditions ) : integer |
Delete rows in a database table. |
|
errorCode ( ) : mixed |
Fetch the SQLSTATE associated with the last operation on the database
handle |
|
errorInfo ( ) : array |
Fetch extended error information associated with the last operation on
the database handle |
|
escapeIdentifier ( string $string, boolean $quote = true ) : string |
Make sure only valid characters make it in column/table names |
|
escapeLikeValue ( string $value ) : string |
Escape a value that will be used as a LIKE condition. |
|
escapeValueSet ( array $values, string $type = 'string' ) : string |
Create a parenthetical statement e.g. for NOT IN queries. |
|
exec ( $args ) : integer |
Execute an SQL statement and return the number of affected rows |
|
exists ( string $statement, $params ) : boolean |
Use with SELECT COUNT queries to determine if a record exists. |
|
first ( string $statement, $params ) : mixed |
Get the first column of each row |
|
getAttribute ( $args ) : mixed |
Retrieve a database connection attribute |
|
getAvailableDrivers ( ) : array |
Return an array of available PDO drivers |
|
getDriver ( ) : string |
Which database driver are we operating on? |
|
getPdo ( ) : PDO |
Return a copy of the PDO object (to prevent it from being modified
to disable safety/security features). |
|
inTransaction ( ) : boolean |
Checks if inside a transaction |
|
insert ( string $table, array $map ) : integer |
Insert a new row to a table in a database. |
|
insertGet ( string $table, array $map, string $field ) : mixed |
Insert a new record then get a particular field from the new row |
|
insertMany ( string $table, array $maps ) : integer |
Insert many new rows to a table in a database. using the same prepared statement |
|
is1DArray ( array $params ) : boolean |
Make sure none of this array's elements are arrays |
|
lastInsertId ( $args ) : string |
Returns the ID of the last inserted row or sequence value |
|
prepare ( $args ) : PDOStatement |
Prepares a statement for execution and returns a statement object |
|
q ( string $statement, $params ) : mixed |
Variadic shorthand for $this->safeQuery() |
|
query ( $args ) : PDOStatement |
Executes an SQL statement, returning a result set as a PDOStatement object |
|
quote ( $args ) : string |
Quotes a string for use in a query |
|
rollBack ( ) : boolean |
Rolls back a transaction |
|
row ( string $statement, $params ) : mixed |
Similar to $this->q() except it only returns a single row |
|
run ( string $statement, $params ) : mixed |
Variadic shorthand for $this->safeQuery() |
|
safeQuery ( string $statement, array $params = [], integer $fetchStyle = PDO::FETCH_ASSOC, boolean $returnNumAffected = false ) : array | integer |
Perform a Parametrized Query |
|
setAllowSeparators ( boolean $value ) : self |
|
|
setAttribute ( integer $attr, mixed $value ) : boolean |
Set an attribute |
|
single ( string $statement, array $params = [] ) : mixed |
Fetch a single result -- useful for SELECT COUNT() queries |
|
update ( string $table, array $changes, array $conditions ) : integer |
Update a row in a database table. |
|