Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
isConnected () | |
closeConnection () | |
prepare ($sql) | |
_getExecuteMode () | |
_setExecuteMode ($mode) | |
getQuoteIdentifierSymbol () | |
listTables ($schema=null) | |
describeTable ($tableName, $schemaName=null) | |
lastSequenceId ($sequenceName) | |
nextSequenceId ($sequenceName) | |
lastInsertId ($tableName=null, $primaryKey=null, $idType=null) | |
setFetchMode ($mode) | |
limit ($sql, $count, $offset=0) | |
supportsParameters ($type) | |
getServerVersion () | |
isI5 () | |
![]() | |
__construct ($config) | |
getConnection () | |
getConfig () | |
setProfiler ($profiler) | |
getProfiler () | |
getStatementClass () | |
setStatementClass ($class) | |
query ($sql, $bind=array()) | |
beginTransaction () | |
commit () | |
rollBack () | |
insert ($table, array $bind) | |
update ($table, array $bind, $where='') | |
delete ($table, $where='') | |
select () | |
getFetchMode () | |
fetchAll ($sql, $bind=array(), $fetchMode=null) | |
fetchRow ($sql, $bind=array(), $fetchMode=null) | |
fetchAssoc ($sql, $bind=array()) | |
fetchCol ($sql, $bind=array()) | |
fetchPairs ($sql, $bind=array()) | |
fetchOne ($sql, $bind=array()) | |
quote ($value, $type=null) | |
quoteInto ($text, $value, $type=null, $count=null) | |
quoteIdentifier ($ident, $auto=false) | |
quoteColumnAs ($ident, $alias, $auto=false) | |
quoteTableAs ($ident, $alias=null, $auto=false) | |
getQuoteIdentifierSymbol () | |
lastSequenceId ($sequenceName) | |
nextSequenceId ($sequenceName) | |
foldCase ($key) | |
__sleep () | |
__wakeup () | |
listTables () | |
describeTable ($tableName, $schemaName=null) | |
isConnected () | |
closeConnection () | |
prepare ($sql) | |
lastInsertId ($tableName=null, $primaryKey=null) | |
setFetchMode ($mode) | |
limit ($sql, $count, $offset=0) | |
supportsParameters ($type) | |
getServerVersion () | |
Protected Member Functions | |
_connect () | |
_quote ($value) | |
_beginTransaction () | |
_commit () | |
_rollBack () | |
_determineI5 () | |
_i5listTables ($schema=null) | |
_i5LastInsertId ($objectName=null, $idType=null) | |
![]() | |
_checkRequiredOptions (array $config) | |
_whereExpr ($where) | |
_quote ($value) | |
_quoteIdentifierAs ($ident, $alias=null, $auto=false, $as=' AS ') | |
_quoteIdentifier ($value, $auto=false) | |
_connect () | |
_beginTransaction () | |
_commit () | |
_rollBack () | |
Protected Attributes | |
$_config | |
$_execute_mode = DB2_AUTOCOMMIT_ON | |
$_defaultStmtClass = 'Zend_Db_Statement_Db2' | |
$_isI5 = false | |
$_numericDataTypes | |
![]() | |
$_config = array() | |
$_fetchMode = Zend_Db::FETCH_ASSOC | |
$_profiler | |
$_defaultStmtClass = 'Zend_Db_Statement' | |
$_defaultProfilerClass = 'Zend_Db_Profiler' | |
$_connection = null | |
$_caseFolding = Zend_Db::CASE_NATURAL | |
$_autoQuoteIdentifiers = true | |
$_numericDataTypes | |
$_allowSerialization = true | |
$_autoReconnectOnUnserialize = false | |
|
protected |
|
protected |
Commit a transaction.
Definition at line 588 of file Db2.php.
|
protected |
Creates a connection resource.
Definition at line 119 of file Db2.php.
|
protected |
_getExecuteMode | ( | ) |
|
protected |
Definition at line 817 of file Db2.php.
|
protected |
|
protected |
Quote a raw string.
string | $value | Raw string |
Use db2_escape_string() if it is present in the IBM DB2 extension. But some supported versions of PHP do not include this function, so fall back to default quoting in the parent class.
Definition at line 281 of file Db2.php.
|
protected |
Rollback a transaction.
Definition at line 608 of file Db2.php.
_setExecuteMode | ( | $mode | ) |
integer | $mode |
Definition at line 257 of file Db2.php.
closeConnection | ( | ) |
describeTable | ( | $tableName, | |
$schemaName = null |
|||
) |
Returns the column descriptions for a table.
The return value is an associative array keyed by the column name, as returned by the RDBMS.
The value of each array element is an associative array with the following keys:
SCHEMA_NAME => string; name of database or schema TABLE_NAME => string; COLUMN_NAME => string; column name COLUMN_POSITION => number; ordinal position of column in table DATA_TYPE => string; SQL datatype name of column DEFAULT => string; default expression of column, null if none NULLABLE => boolean; true if column can have nulls LENGTH => number; length of CHAR/VARCHAR SCALE => number; scale of NUMERIC/DECIMAL PRECISION => number; precision of NUMERIC/DECIMAL UNSIGNED => boolean; unsigned property of an integer type DB2 not supports UNSIGNED integer. PRIMARY => boolean; true if column is part of the primary key PRIMARY_POSITION => integer; position of column in primary key IDENTITY => integer; true if column is auto-generated with unique values
string | $tableName | |
string | $schemaName | OPTIONAL |
To avoid case issues, fetch using FETCH_NUM
The ordering of columns is defined by the query so we can map to variables to improve readability
In IBM DB2, an column can be IDENTITY even if it is not part of the PRIMARY KEY.
Definition at line 376 of file Db2.php.
getServerVersion | ( | ) |
isConnected | ( | ) |
isI5 | ( | ) |
lastInsertId | ( | $tableName = null , |
|
$primaryKey = null , |
|||
$idType = null |
|||
) |
Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
As a convention, on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence from the arguments and returns the last id generated by that sequence. On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method returns the last value generated for such a column, and the table name argument is disregarded.
The IDENTITY_VAL_LOCAL() function gives the last generated identity value in the current process, even if it was for a GENERATED column.
string | $tableName | OPTIONAL |
string | $primaryKey | OPTIONAL |
string | $idType | OPTIONAL used for i5 platform to define sequence/idenity unique value |
Definition at line 551 of file Db2.php.
lastSequenceId | ( | $sequenceName | ) |
Return the most recent value from the specified sequence in the database. This is supported only on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.
string | $sequenceName |
Definition at line 500 of file Db2.php.
limit | ( | $sql, | |
$count, | |||
$offset = 0 |
|||
) |
Adds an adapter-specific LIMIT clause to the SELECT statement.
string | $sql | |
integer | $count | |
integer | $offset | OPTIONAL |
DB2 does not implement the LIMIT clause as some RDBMS do. We have to simulate it with subqueries and ROWNUM. Unfortunately because we use the column wildcard "*", this puts an extra column into the query result set.
Definition at line 663 of file Db2.php.
listTables | ( | $schema = null | ) |
nextSequenceId | ( | $sequenceName | ) |
Generate a new value from the specified sequence in the database, and return it. This is supported only on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.
string | $sequenceName |
prepare | ( | $sql | ) |
Returns an SQL statement for preparation.
string | $sql | The SQL statement with placeholders. |
Definition at line 230 of file Db2.php.
setFetchMode | ( | $mode | ) |
Set the fetch mode.
integer | $mode |
Zend_Db_Adapter_Db2_Exception |
Definition at line 629 of file Db2.php.
supportsParameters | ( | $type | ) |
|
protected |
|
protected |
|
protected |