Properties

$statement

$statement : \PDOStatement

Reference to the last executed query

Type

\PDOStatement

$escapeCharOpen

$escapeCharOpen : string

Start character to escape identifiers

Type

string

$escapeCharClose

$escapeCharClose : string

End character to escape identifiers

Type

string

$lastQuery

$lastQuery : string

Last query executed

Type

string

$tablePrefix

$tablePrefix : string

Prefix to apply to table names

Type

string

$hasTruncate

$hasTruncate : boolean

Firebird doesn't have the truncate keyword

Type

boolean

$statementLink

$statementLink : resource

Reference to the resource returned by the last query executed

Type

resource

$trans

$trans : resource

Reference to the current transaction

Type

resource

$conn

$conn : resource

Reference to the connection resource

Type

resource

$service

$service : resource

Reference to the service resource

Type

resource

Methods

__construct()

__construct(string  $dbpath, string  $user = 'SYSDBA', string  $pass = 'masterkey', array  $options = array()) 

Open the link to the database

Parameters

string $dbpath
string $user
string $pass
array $options

Throws

\PDOException

__call()

__call(string  $name, array  $args = array()) : mixed

Allow invoke to work on table object

Parameters

string $name
array $args

Returns

mixed

getLastQuery()

getLastQuery() : string

Get the last sql query executed

Returns

string

setLastQuery()

setLastQuery(string  $queryString) : void

Set the last query sql

Parameters

string $queryString

setTablePrefix()

setTablePrefix(string  $prefix) : void

Set the common table name prefix

Parameters

string $prefix

prepareQuery()

prepareQuery(string  $sql, array  $params) : NULL

Bind a prepared query with arguments for executing

Parameters

string $sql
array $params

Returns

NULL

prepareExecute()

prepareExecute(string  $sql, array  $args) : \Query\Drivers\Firebird\Result

Prepare and execute a query

Parameters

string $sql
array $args

Returns

\Query\Drivers\Firebird\Result

affectedRows()

affectedRows() : integer

Returns number of rows affected by an INSERT, UPDATE, DELETE type query

Returns

integer

prefixTable()

prefixTable(string  $table) : string

Prefixes a table if it is not already prefixed

Parameters

string $table

Returns

string

quoteTable()

quoteTable(string  $table) : string

Quote database table name, and set prefix

Parameters

string $table

Returns

string

quoteIdent()

quoteIdent(mixed  $identifier) : string

Surrounds the string with the databases identifier escape characters

Parameters

mixed $identifier

Returns

string

getSchemas()

getSchemas() : array

Return schemas for databases that list them

Returns

array

getTables()

getTables() : array

Return list of tables for the current database

Returns

array

getDbs()

getDbs() : array

Return list of dbs for the current connection, if possible

Returns

array

getViews()

getViews() : array

Return list of views for the current database

Returns

array

getSequences()

getSequences() : array

Return list of sequences for the current database, if they exist

Returns

array

getFunctions()

getFunctions() : array

Return list of functions for the current database

Returns

array

getProcedures()

getProcedures() : array

Return list of stored procedures for the current database

Returns

array

getTriggers()

getTriggers() : array

Return list of triggers for the current database

Returns

array

getSystemTables()

getSystemTables() : array

Retrieves an array of non-user-created tables for the connection/database

Returns

array

getColumns()

getColumns(string  $table) : array

Retrieve column information for the current database table

Parameters

string $table

Returns

array

getFks()

getFks(string  $table) : array

Retrieve foreign keys for the table

Parameters

string $table

Returns

array

getIndexes()

getIndexes(string  $table) : array

Retrieve indexes for the table

Parameters

string $table

Returns

array

getTypes()

getTypes() : array

Retrieve list of data types for the database

Returns

array

driverQuery()

driverQuery(string|array|null  $query, boolean  $filteredIndex = TRUE) : array

Method to simplify retrieving db results for meta-data queries

Parameters

string|array|null $query
boolean $filteredIndex

Returns

array

numRows()

numRows() : integer|null

Return the number of rows returned for a SELECT query

Returns

integer|null

insertBatch()

insertBatch(string  $table, array  $data = array()) : array

Create sql for batch insert

Parameters

string $table
array $data

Returns

array

updateBatch()

updateBatch(string  $table, array|object  $data, string  $where) : integer|null

Creates a batch update, and executes it.

Returns the number of affected rows

Parameters

string $table
array|object $data
string $where

Returns

integer|null

_quote()

_quote(mixed  $str) : mixed

Helper method for quote_ident

Parameters

mixed $str

Returns

mixed

truncate()

truncate(string  $table) : \PDOStatement

Empty the passed table

Parameters

string $table

Returns

\PDOStatement

__destruct()

__destruct() 

Cleanup some loose ends

getService()

getService() : resource

Return service handle

Returns

resource

exec()

exec(string  $sql) : integer

Execute an sql statement and return number of affected rows

Parameters

string $sql

Returns

integer

getAttribute()

getAttribute(integer  $attribute) : mixed

Implement for compatibility with PDO

Parameters

integer $attribute

Returns

mixed

inTransaction()

inTransaction() : boolean

Return whether the current statement is in a transaction

Returns

boolean

lastInsertId()

lastInsertId(string  $name = NULL) : mixed

Returns the last value of the specified generator

Parameters

string $name

Returns

mixed

query()

query(string  $sql = '') : \Query\Drivers\Firebird\Result

Wrapper public function to better match PDO

Parameters

string $sql

Throws

\PDOException

Returns

\Query\Drivers\Firebird\Result

prepare()

prepare(string  $query, array  $options = array()) : \Query\Drivers\Firebird\Result

Emulate PDO prepare

Parameters

string $query
array $options

Throws

\PDOException

Returns

\Query\Drivers\Firebird\Result

beginTransaction()

beginTransaction() : boolean|null

Start a database transaction

Returns

boolean|null

commit()

commit() : boolean

Commit a database transaction

Returns

boolean

rollBack()

rollBack() : boolean

Rollback a transaction

Returns

boolean

setAttribute()

setAttribute(integer  $attribute, mixed  $value) : boolean

Set a connection attribute

Parameters

integer $attribute
mixed $value

Returns

boolean

quote()

quote(string  $str, integer  $paramType = \PDO::PARAM_STR) : string

Method to emulate PDO->quote

Parameters

string $str
integer $paramType

Returns

string

errorInfo()

errorInfo() : array

Method to emulate PDO->errorInfo / PDOStatement->errorInfo

Returns

array

errorCode()

errorCode() : array

Method to emulate PDO->errorCode

Returns

array

_loadSubClasses()

_loadSubClasses() : void

Loads the subclasses for the driver

_prefix()

_prefix(string  $str) : string

Sets the table prefix on the passed string

Parameters

string $str

Returns

string