Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
isConnected () | |
closeConnection () | |
prepare ($sql) | |
lastInsertId ($tableName=null, $primaryKey=null) | |
query ($sql, $bind=array()) | |
exec ($sql) | |
setFetchMode ($mode) | |
supportsParameters ($type) | |
getServerVersion () | |
![]() | |
__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 | |
_dsn () | |
_connect () | |
_quote ($value) | |
_beginTransaction () | |
_commit () | |
_rollBack () | |
![]() | |
_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 | |
$_defaultStmtClass = 'Zend_Db_Statement_Pdo' | |
![]() | |
$_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 | |
Definition at line 45 of file Abstract.php.
|
protected |
|
protected |
|
protected |
Creates a PDO object and connects to the database.
Zend_Db_Adapter_Exception |
Definition at line 87 of file Abstract.php.
|
protected |
Creates a PDO DSN for the adapter from $this->_config settings.
Definition at line 60 of file Abstract.php.
|
protected |
Quote a raw string.
string | $value | Raw string |
Definition at line 290 of file Abstract.php.
|
protected |
closeConnection | ( | ) |
exec | ( | $sql | ) |
Executes an SQL statement and return the number of affected rows
mixed | $sql | The SQL statement with placeholders. May be a string or Zend_Db_Select. |
Definition at line 256 of file Abstract.php.
getServerVersion | ( | ) |
isConnected | ( | ) |
lastInsertId | ( | $tableName = null , |
|
$primaryKey = 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.
On RDBMS brands that don't support sequences, $tableName and $primaryKey are ignored.
string | $tableName | OPTIONAL Name of table. |
string | $primaryKey | OPTIONAL Name of primary key column. |
Definition at line 206 of file Abstract.php.
prepare | ( | $sql | ) |
Prepares an SQL statement.
string | $sql | The SQL statement with placeholders. |
array | $bind | An array of data to bind to the placeholders. |
Definition at line 176 of file Abstract.php.
query | ( | $sql, | |
$bind = array() |
|||
) |
Special handling for PDO query(). All bind parameter names must begin with ':'
string | Zend_Db_Select | $sql | The SQL statement with placeholders. |
array | $bind | An array of data to bind to the placeholders. |
Zend_Db_Adapter_Exception | To re-throw PDOException. |
Definition at line 221 of file Abstract.php.
setFetchMode | ( | $mode | ) |
Set the PDO fetch mode.
int | $mode | A PDO fetch mode. |
Zend_Db_Adapter_Exception |
Definition at line 334 of file Abstract.php.
supportsParameters | ( | $type | ) |
Check if the adapter supports real SQL parameters.
string | $type | 'positional' or 'named' |
Definition at line 369 of file Abstract.php.
|
protected |
Definition at line 53 of file Abstract.php.