db\Command cancel()

cancel() public method Cancels the execution of the SQL statement. This method mainly sets $pdoStatement to be null. public void cancel ( )

db\Command cache()

cache() public method Enables query cache for this command. public $this cache ( $duration = null, $dependency = null )$duration integer The number of seconds that query result of this command can remain valid in the cache. If this is not set, the value of yii\db\Connection::$queryCacheDuration will be used instead. Use 0 to indicate that the cached data will never expire. $dependency yii\caching\Dependency The cache dependency associated with the cached query result. return $this Th

db\Command bindValues()

bindValues() public method Binds a list of values to the corresponding parameters. This is similar to bindValue() except that it binds multiple values at a time. Note that the SQL data type of each value is determined by its PHP type. public $this bindValues ( $values )$values array The values to be bound. This must be given in terms of an associative array with array keys being the parameter names, and array values the corresponding parameter values, e.g. [':name' => 'John', ':age' =

db\Command bindValue()

bindValue() public method Binds a value to a parameter. See also http://www.php.net/manual/en/function.PDOStatement-bindValue.php. public $this bindValue ( $name, $value, $dataType = null )$name string|integer Parameter identifier. For a prepared statement using named placeholders, this will be a parameter name of the form :name. For a prepared statement using question mark placeholders, this will be the 1-indexed position of the parameter. $value mixed The value to bind to the param

db\Command bindPendingParams()

bindPendingParams() protected method Binds pending parameters that were registered via bindValue() and bindValues(). Note that this method requires an active $pdoStatement. protected void bindPendingParams ( )

db\Command bindParam()

bindParam() public method Binds a parameter to the SQL statement to be executed. See also http://www.php.net/manual/en/function.PDOStatement-bindParam.php. public $this bindParam ( $name, &$value, $dataType = null, $length = null, $driverOptions = null )$name string|integer Parameter identifier. For a prepared statement using named placeholders, this will be a parameter name of the form :name. For a prepared statement using question mark placeholders, this will be the 1-indexed pos

db\Command batchInsert()

batchInsert() public method Creates a batch INSERT command. For example, $connection->createCommand()->batchInsert('user', ['name', 'age'], [ ['Tom', 30], ['Jane', 20], ['Linda', 25], ])->execute(); The method will properly escape the column names, and quote the values to be inserted. Note that the values in each row must match the corresponding column names. Also note that the created command is not executed until execute() is called. public $this batchInsert ( $tab

db\Command alterColumn()

alterColumn() public method Creates a SQL command for changing the definition of a column. public $this alterColumn ( $table, $column, $type )$table string The table whose column is to be changed. The table name will be properly quoted by the method. $column string The name of the column to be changed. The name will be properly quoted by the method. $type string The column type. yii\db\QueryBuilder::getColumnType() will be called to convert the give column type to the physical one. F

db\Command addPrimaryKey()

addPrimaryKey() public method Creates a SQL command for adding a primary key constraint to an existing table. The method will properly quote the table and column names. public $this addPrimaryKey ( $name, $table, $columns )$name string The name of the primary key constraint. $table string The table that the primary key constraint will be added to. $columns string|array Comma separated string or array of columns that the primary key will consist of. return $this The command object

db\Command addForeignKey()

addForeignKey() public method Creates a SQL command for adding a foreign key constraint to an existing table. The method will properly quote the table and column names. public $this addForeignKey ( $name, $table, $columns, $refTable, $refColumns, $delete = null, $update = null )$name string The name of the foreign key constraint. $table string The table that the foreign key constraint will be added to. $columns string|array The name of the column to that the constraint will be adde