db\Command truncateTable()

truncateTable() public method Creates a SQL command for truncating a DB table. public $this truncateTable ( $table )$table string The table to be truncated. The name will be properly quoted by the method. return $this The command object itself

db\Command setSql()

setSql() public method Specifies the SQL statement to be executed. The previous SQL execution (if any) will be cancelled, and $params will be cleared as well. public $this setSql ( $sql )$sql string The SQL statement to be set. return $this This command instance

db\Command resetSequence()

resetSequence() public method Creates a SQL command for resetting the sequence value of a table's primary key. The sequence will be reset such that the primary key of the next new row inserted will have the specified value or 1. public $this resetSequence ( $table, $value = null )$table string The name of the table whose primary key sequence will be reset $value mixed The value for the primary key of the next new row inserted. If this is not set, the next new row's primary key will hav

db\Command requireTableSchemaRefresh()

requireTableSchemaRefresh() protected method (available since version 2.0.6) Marks a specified table schema to be refreshed after command execution. protected $this requireTableSchemaRefresh ( $name )$name string Name of the table, which schema should be refreshed. return $this This command instance

db\Command renameTable()

renameTable() public method Creates a SQL command for renaming a DB table. public $this renameTable ( $table, $newName )$table string The table to be renamed. The name will be properly quoted by the method. $newName string The new table name. The name will be properly quoted by the method. return $this The command object itself

db\Command renameColumn()

renameColumn() public method Creates a SQL command for renaming a column. public $this renameColumn ( $table, $oldName, $newName )$table string The table whose column is to be renamed. The name will be properly quoted by the method. $oldName string The old name of the column. The name will be properly quoted by the method. $newName string The new name of the column. The name will be properly quoted by the method. return $this The command object itself

db\Command refreshTableSchema()

refreshTableSchema() protected method (available since version 2.0.6) Refreshes table schema, which was marked by requireTableSchemaRefresh() protected void refreshTableSchema ( )

db\Command queryScalar()

queryScalar() public method Executes the SQL statement and returns the value of the first column in the first row of data. This method is best used when only a single value is needed for a query. public string|null|false queryScalar ( )return string|null|false The value of the first column in the first row of the query result. False is returned if there is no value. throws yii\db\Exception execution failed

db\Command queryOne()

queryOne() public method Executes the SQL statement and returns the first row of the result. This method is best used when only the first row of result is needed for a query. public array|false queryOne ( $fetchMode = null )$fetchMode integer The result fetch mode. Please refer to PHP manual for valid fetch modes. If this parameter is null, the value set in $fetchMode will be used. return array|false The first row (in terms of an array) of the query result. False is returned if the q

db\Command queryInternal()

queryInternal() protected method (available since version 2.0.1) Performs the actual DB query of a SQL statement. protected mixed queryInternal ( $method, $fetchMode = null )$method string Method of PDOStatement to be called $fetchMode integer The result fetch mode. Please refer to PHP manual for valid fetch modes. If this parameter is null, the value set in $fetchMode will be used. return mixed The method execution result throws yii\db\Exception if the query causes any problem