db\Connection open()

open() public method Establishes a DB connection. It does nothing if a DB connection has already been established. public void open ( )throws yii\db\Exception if connection fails

db\Connection noCache()

noCache() public method Disables query cache temporarily. Queries performed within the callable will not use query cache at all. For example, $db->cache(function (Connection $db) { // ... queries that use query cache ... return $db->noCache(function (Connection $db) { // this query will not use query cache return $db->createCommand('SELECT * FROM customer WHERE id=1')->queryOne(); }); }); See also: $enableQueryCache $queryCache cache() public mix

db\Connection quoteColumnName()

quoteColumnName() public method Quotes a column name for use in a query. If the column name contains prefix, the prefix will also be properly quoted. If the column name is already quoted or contains special characters including '(', '[[' and '{{', then this method will do nothing. public string quoteColumnName ( $name )$name string Column name return string The properly quoted column name

db\Connection getTransaction()

getTransaction() public method Returns the currently active transaction. public yii\db\Transaction getTransaction ( )return yii\db\Transaction The currently active transaction. Null if no active transaction.

db\Connection initConnection()

initConnection() protected method Initializes the DB connection. This method is invoked right after the DB connection is established. The default implementation turns on PDO::ATTR_EMULATE_PREPARES if $emulatePrepare is true, and sets the database $charset if it is not empty. It then triggers an EVENT_AFTER_OPEN event. protected void initConnection ( )

db\Connection getTableSchema()

getTableSchema() public method Obtains the schema information for the named table. public yii\db\TableSchema getTableSchema ( $name, $refresh = false )$name string Table name. $refresh boolean Whether to reload the table schema even if it is found in the cache. return yii\db\TableSchema Table schema information. Null if the named table does not exist.

db\Connection getSlave()

getSlave() public method Returns the currently active slave connection. If this method is called the first time, it will try to open a slave connection when $enableSlaves is true. public yii\db\Connection getSlave ( $fallbackToMaster = true )$fallbackToMaster boolean Whether to return a master connection in case there is no slave connection available. return yii\db\Connection The currently active slave connection. Null is returned if there is slave available and $fallbackToMaster is fa

db\Connection getSlavePdo()

getSlavePdo() public method Returns the PDO instance for the currently active slave connection. When $enableSlaves is true, one of the slaves will be used for read queries, and its PDO instance will be returned by this method. public PDO getSlavePdo ( $fallbackToMaster = true )$fallbackToMaster boolean Whether to return a master PDO in case none of the slave connections is available. return PDO The PDO instance for the currently active slave connection. Null is returned if no slave con

db\Connection getSchema()

getSchema() public method Returns the schema information for the database opened by this connection. public yii\db\Schema getSchema ( )return yii\db\Schema The schema information for the database opened by this connection. throws yii\base\NotSupportedException if there is no support for the current driver type

db\Connection getMasterPdo()

getMasterPdo() public method Returns the PDO instance for the currently active master connection. This method will open the master DB connection and then return $pdo. public PDO getMasterPdo ( )return PDO The PDO instance for the currently active master connection.