Query\Drivers\AbstractDriver
Base Database class
Extends PDO to simplify cross-database issues
Synopsis
class AbstractDriver
extends PDO
implements
DriverInterface
{
- // methods
- public void __construct()
- public mixed __call()
- public string getLastQuery()
- public void setLastQuery()
- public SQLInterface getSql()
- public AbstractUtil getUtil()
- public void setTablePrefix()
- public PDOStatement prepareQuery()
- public PDOStatement prepareExecute()
- public int affectedRows()
- public string prefixTable()
- public string quoteTable()
- public string|array quoteIdent()
- public ?array getSchemas()
- public ?array getTables()
- public ?array getDbs()
- public ?array getViews()
- public ?array getSequences()
- public ?array getFunctions()
- public ?array getProcedures()
- public ?array getTriggers()
- public ?array getSystemTables()
- public ?array getColumns()
- public ?array getFks()
- public ?array getIndexes()
- public ?array getTypes()
- public string getVersion()
- public ?array driverQuery()
- public ?int numRows()
- public array insertBatch()
- public array updateBatch()
- public PDOStatement truncate()
- public string returning()
- public mixed _quote()
- // Inherited methods from PDO
- public void __construct()
- public bool beginTransaction()
- public bool commit()
- public string errorCode()
- public array errorInfo()
- public int exec()
- public mixed getAttribute()
- public array getAvailableDrivers()
- public bool inTransaction()
- public string lastInsertId()
- public PDOStatement prepare()
- public PDOStatement query()
- public string quote()
- public bool rollBack()
- public bool setAttribute()
Hierarchy
Violations
PHPMessDetector
Line | Rule | Message |
---|---|---|
82 - 721 | TooManyPublicMethods | The class AbstractDriver has 15 public methods. Consider refactoring AbstractDriver to keep number of public methods under 10. |
82 - 721 | ExcessiveClassComplexity | The class AbstractDriver has an overall complexity of 62 which is very high. The configured complexity threshold is 50. |
500 | BooleanArgumentFlag | The method driverQuery has a boolean flag argument $filteredIndex, which is a certain sign of a Single Responsibility Principle violation. |
690 - 703 | CamelCaseMethodName | The method _quote is not named in camelCase. |
Methods
public
- __construct() — PDO constructor wrapper
- __call() — Allow invoke to work on table object
- _quote() — Helper method for quote_ident
- affectedRows() — Returns number of rows affected by an INSERT, UPDATE, DELETE type query
- driverQuery() — Method to simplify retrieving db results for meta-data queries
- getColumns() — Retrieve column information for the current database table
- getDbs() — Return list of dbs for the current connection, if possible
- getFks() — Retrieve foreign keys for the table
- getFunctions() — Return list of functions for the current database
- getIndexes() — Retrieve indexes for the table
- getLastQuery() — Get the last sql query executed
- getProcedures() — Return list of stored procedures for the current database
- getSchemas() — Return schemas for databases that list them
- getSequences() — Return list of sequences for the current database, if they exist
- getSql() — Get the SQL class for the current driver
- getSystemTables() — Retrieves an array of non-user-created tables for the connection/database
- getTables() — Return list of tables for the current database
- getTriggers() — Return list of triggers for the current database
- getTypes() — Retrieve list of data types for the database
- getUtil() — Get the Util class for the current driver
- getVersion() — Get the version of the database engine
- getViews() — Return list of views for the current database
- insertBatch() — Create sql for batch insert
- numRows() — Return the number of rows returned for a SELECT query
- prefixTable() — Prefixes a table if it is not already prefixed
- prepareExecute() — Create and execute a prepared statement with the provided parameters
- prepareQuery() — Simplifies prepared statements for database queries
- quoteIdent() — Surrounds the string with the databases identifier escape characters
- quoteTable() — Quote database table name, and set prefix
- returning() — Generate the returning clause for the current database
- setLastQuery() — Set the last query sql
- setTablePrefix() — Set the common table name prefix
- truncate() — Empty the passed table
- updateBatch() — Creates a batch update, and executes it.
Inherited from PDO
public
- beginTransaction() — Initiates a transaction
- commit() — Commits a transaction
- errorCode() — Fetch the SQLSTATE associated with the last operation on the database handle
- errorInfo() — Fetch extended error information associated with the last operation on the database handle
- exec() — Execute an SQL statement and return the number of affected rows
- getAttribute() — Retrieve a database connection attribute
- getAvailableDrivers() — Return an array of available PDO drivers
- inTransaction() — Checks if inside a transaction
- lastInsertId() — Returns the ID of the last inserted row or sequence value
- prepare() — Prepares a statement for execution and returns a statement object
- query() — Executes an SQL statement, returning a result set as a PDOStatement object
- quote() — Quotes a string for use in a query
- rollBack() — Rolls back a transaction
- setAttribute() — Set an attribute