db\Connection createCommand()

createCommand() public method Creates a command for execution. public yii\db\Command createCommand ( $sql = null, $params = [] )$sql string The SQL statement to be executed $params array The parameters to be bound to the SQL statement return yii\db\Command The DB command

db\Connection cache()

cache() public method Uses query cache for the queries performed with the callable. When query caching is enabled ($enableQueryCache is true and $queryCache refers to a valid cache), queries performed within the callable will be cached and their results will be fetched from cache if available. For example, // The customer will be fetched from cache if available. // If not, the query will be made against DB and cached for use next time. $customer = $db->cache(function (Connection $db) {

db\Connection beginTransaction()

beginTransaction() public method Starts a transaction. public yii\db\Transaction beginTransaction ( $isolationLevel = null )$isolationLevel string|null The isolation level to use for this transaction. See yii\db\Transaction::begin() for details. return yii\db\Transaction The transaction initiated

db\Connection close()

close() public method Closes the currently active DB connection. It does nothing if the connection is already closed. public void close ( )

db\Connection $tablePrefix

$tablePrefix public property The common prefix or suffix for table names. If a table name is given as {{%TableName}}, then the percentage character % will be replaced with this property value. For example, {{%post}} becomes {{tbl_post}}. public string $tablePrefix = ''

db\Connection $transaction

$transaction public read-only property The currently active transaction. Null if no active transaction. public yii\db\Transaction getTransaction ( )

db\Connection $username

$username public property The username for establishing DB connection. Defaults to null meaning no username to use. public string $username = null

db\Connection $slave

$slave public read-only property The currently active slave connection. Null is returned if there is slave available and $fallbackToMaster is false. public yii\db\Connection getSlave ( $fallbackToMaster = true )

db\Connection $slaveConfig

$slaveConfig public property The configuration that should be merged with every slave configuration listed in $slaves. For example, [ 'username' => 'slave', 'password' => 'slave', 'attributes' => [ // use a smaller connection timeout PDO::ATTR_TIMEOUT => 10, ], ] public array $slaveConfig = []

db\Connection $slaves

$slaves public property List of slave connection configurations. Each configuration is used to create a slave DB connection. When $enableSlaves is true, one of these configurations will be chosen and used to create a DB connection for performing read queries only. See also: $enableSlaves $slaveConfig public array $slaves = []