Squiz Matrix
4.12.2
|
Static Public Member Functions | |
static | getQuery ($systemid, $queryid, $bindValues=TRUE) |
static | getAssoc (Query $dalQuery, $col=NULL) |
static | getAll (Query $dalQuery) |
static | getOne (Query $dalQuery) |
static | getDALQuery ($systemid, $queryid, $method) |
static | getGrouped (Query $dalQuery) |
static | getGroupedAssoc (Query $dalQuery) |
static | executeGrouped ($systemid, $queryid) |
static | executeGroupedAssoc ($systemid, $queryid) |
static | executeAssoc ($systemid, $queryid, $col=NULL) |
static | executeAll ($systemid, $queryid) |
static | executeOne ($systemid, $queryid) |
static | executeQuery ($systemid, $queryid=NULL) |
static | getExecuteQuery ($systemid, $queryid=NULL) |
static | getExecuteAll ($systemid, $queryid) |
static | executeDALQuery (Query $query, $execMethod=NULL) |
static | execPdoQuery ($query) |
static | executePdoAssoc ($query, $col=NULL) |
static | executePdoAll ($query) |
static | executePdoGrouped ($query) |
static | executePdoGroupedAssoc ($query) |
static | executePdoOne ($query) |
static | executeSql ($sql) |
static | executeSqlAssoc ($sql, $col=NULL) |
static | executeSqlAll ($sql) |
static | executeSqlGrouped ($sql) |
static | executeSqlGroupedAssoc ($sql) |
static | executeSqlOne ($sql) |
static | executeQueries ($sql) |
static | query ($sql) |
static | beginTransaction () |
static | commit () |
static | rollBack () |
static | lastInsertId ($sequenceName) |
static | dbConnect (array &$dsn=NULL, $conn_id='db', $oci_force_new=FALSE) |
static | changeDb ($conn_id) |
static | restoreDb () |
static | getCurrentDbId () |
static | transactionSupport ($conn_id=NULL) |
static | dbClose ($conn_id) |
static | dbConnected ($conn_id=NULL) |
static | getDsn ($conn_id=NULL) |
static | getDsnFromConfig ($conn_id) |
static | getDbName ($conn_id) |
static | getDb ($conn_id=NULL) |
static | getDbType ($readable=FALSE, $conn_id=NULL) |
static | requireQueryClass ($systemid) |
static | getOvenPath ($system=NULL) |
static | getQueryStorePath () |
static | getQueryObject ($id) |
static | getSqlQueriesFromFile ($path) |
static | isDALQuery ($query) |
static | getLoggedQueries () |
static | clearLoggedQueries () |
static | setOciCommitOnSuccess ($switch) |
Static Protected Member Functions | |
static | _startQueryTimer ($query) |
static | _endQueryTimer () |
DAL.
DAL (Database Abstraction Layer) class handles parsing of XML SQL queries. It converts XML based SQL queries to generic PHP arrays so that they can be converted to actual SQL queries by the DALConverter class.
DAL class can also validates schemas and quries.
DAL class also handles database connection and access.
NB: the Matrix (MySource 3.x) version of the DAL is resorting to using OCI8 functionality, instead of PDO, when connecting to Oracle (v.9+) databases. This is due to the instability and lack of support of PDO_OCI towards CLOB fields at the moment (as of January 2008). When PDO_OCI better supports the CLOB field type, Oracle support will again use PDO_OCI. Returns from OCI8 will be changed to expected PDO format for consistency.
|
staticprotected |
|
staticprotected |
|
static |
|
static |
Change database connection.
string | $conn_id | Connection ID to change |
DALException | If the connection identified by the ID is not (yet) connected. |
|
static |
|
static |
|
static |
Close the specified database connection.
string | $conn_id | Connection ID to close. |
DALException | If connection doesn't exist, or connection is still in the stack. |
|
static |
Connects to the selected database.
Throws DALException if cannot connect to db else returns PDO object.
array | $dsn | DSN array. This argument has been changed to "pass by reference" type to keep backward compatibility since the support of multiple DSNs (feature #5541) because there are a few places where this DSN array is used as a single DSN after invoking this method, e.g. MySource's changeDatabaseConnection() method. |
string | $conn_id | Unique connection ID |
boolean | $oci_force_new | force a new connection for oci |
DALException | If db connection fails. |
|
static |
Returns true if there is an active database connection.
If the optional $conn_id parameter is provided, this function will return the existence or otherwise of that connection. If omitted, it will return the existence of ANY open connection.
string | $conn_id | Connection ID to check. |
|
static |
|
static |
Returns all rows in an array.
This function will call getQuery() and getAll().
string | $systemid | System's ID. |
string | $queryid | ID of the SQL query. |
|
static |
Returns all rows as an associative array.
This function will call getQuery() and getAssoc().
string | $systemid | System's ID. |
string | $queryid | ID of the SQL query. |
integer | $col | Column to retrieve. |
|
static |
|
static |
|
static |
|
static |
Returns a single value.
This function will call getQuery() and getOne().
string | $systemid | System's ID. |
string | $queryid | ID of the SQL query. |
|
static |
|
static |
Executes the given PDO statement and returns all rows in an associative array.
If optional parameter $col is specified, this does NOT return an associative array, but rather values from a single column.
PDOStatement | $query | PDOStatement object to execute. |
integer | $col | Column to retrieve (zero-indexed). |
|
static |
|
static |
|
static |
|
static |
Executes multiple queries in one SQL string.
Each sql statement must be separated by a semi-colon. Create table statements should use this function since they may have multiple queries to create indexes, constraints, etc. Also, it should not be used for output statements (i.e. SELECT).
string | $sql | SQL statements. |
|
static |
Executes a query and returns the number of rows affected.
Note: $systemid can be a PDOStatement object. If $systemid is PDOStatement then $queryid (2nd argument) can be NULL.
string | object | $systemid | System's ID. |
string | $queryid | ID of the SQL query. |
DALException | If no query provided or query execution failed. |
|
static |
|
static |
|
static |
Executes the given SQL query and returns all rows in an associative array.
If optional parameter $col is specified, this does NOT return an associative array, but rather values from a single column.
string | $sql | Sql query to execute. |
integer | $col | Column to retrieve (zero-indexed). |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Get the current database connection ID.
DALException | If the database connection stack is empty. |
|
static |
Returns an array of data about the SQL query.
This is used if the query is not to be executed yet, and rather a representation of the query's SQL, along with its' bindings and their values.
string | $systemid | System name that the query belongs to. |
string | $queryid | ID of the query. |
string | $method | Method used to retrieve the query(getAssoc etc). |
|
static |
|
static |
|
static |
Returns the current database connection's type.
boolean | $readable | If true readable name will be returned. For example, mysql => Mysql, pgsql => Postgres. |
string | $conn_id | If provided, the function checks this specified connection. If omitted, the function returns the current connection. |
DALException | If db type is not found or it is invalid. |
|
static |
Returns the DSN array for the current database configuration.
string | $conn_id | Connection ID to get details from. If omitted, use current connection. |
DALException | If DSN not configured. |
|
static |
|
static |
|
static |
|
static |
Returns all rows grouped by first column.
DALException | If query execution fails. |
|
static |
Returns all rows grouped by first column, with subsequent fields keyed by their field name.
DALException | If query execution fails. |
|
static |
|
static |
|
static |
|
static |
Returns the PDO query object for the given system and queryid.
string | $systemid | System name that the query belongs to. |
string | $queryid | ID of the query. |
boolean | $bindValues | If TRUE, will add the query to a PDOStatement object and bind its' variables. Otherwise, it will return an array representation of it. |
DALException | If failed to load the query. |
|
static |
Returns the path to store query objects.
string | $id | The ID of the query to retrieve. |
DALException | When object is not found. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Restore database connection.
DALException | If the database connection stack is empty. |
|
static |
|
static |
Switch on/off oci_commit_on_success flag for executing oci queires Mainly used to avoid oracle + bulkmail fork end-of-communication issue In this mode, oci queries will be executed immediately
boolean | switch on/off oci commit on success mode |
|
static |