db\Command queryAll()

queryAll() public method Executes the SQL statement and returns ALL rows at once. public array queryAll ( $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 All rows of the query result. Each array element is an array representing a row of data. An empty array is returned if the query results in nothing. throws yii\db\Exception execution failed

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

db\Command query()

query() public method Executes the SQL statement and returns query result. This method is for executing a SQL query that returns result set, such as SELECT. public yii\db\DataReader query ( )return yii\db\DataReader The reader object for fetching the query result throws yii\db\Exception execution failed

db\Command noCache()

noCache() public method Disables query cache for this command. public $this noCache ( )return $this The command object itself

db\Command prepare()

prepare() public method Prepares the SQL statement to be executed. For complex SQL statement that is to be executed multiple times, this may improve performance. For SQL statement with binding parameters, this method is invoked automatically. public void prepare ( $forRead = null )$forRead boolean Whether this method is called for a read query. If null, it means the SQL statement should be used to determine whether it is for read or write. throws yii\db\Exception if there is any DB err

db\Command getSql()

getSql() public method Returns the SQL statement for this command. public string getSql ( )return string The SQL statement to be executed

db\Command execute()

execute() public method Executes the SQL statement. This method should only be used for executing non-query SQL statement, such as INSERT, DELETE, UPDATE SQLs. No result set will be returned. public integer execute ( )return integer Number of rows affected by the execution. throws yii\db\Exception execution failed

db\Command getRawSql()

getRawSql() public method Returns the raw SQL by inserting parameter values into the corresponding placeholders in $sql. Note that the return value of this method should mainly be used for logging purpose. It is likely that this method returns an invalid SQL due to improper replacement of parameter placeholders. public string getRawSql ( )return string The raw SQL with parameter values inserted into the corresponding placeholders in $sql.

db\Command insert()

insert() public method Creates an INSERT command. For example, $connection->createCommand()->insert('user', [ 'name' => 'Sam', 'age' => 30, ])->execute(); The method will properly escape the column names, and bind the values to be inserted. Note that the created command is not executed until execute() is called. public $this insert ( $table, $columns )$table string The table that new rows will be inserted into. $columns array The column data (name => value) t

db\Command dropIndex()

dropIndex() public method Creates a SQL command for dropping an index. public $this dropIndex ( $name, $table )$name string The name of the index to be dropped. The name will be properly quoted by the method. $table string The table whose index is to be dropped. The name will be properly quoted by the method. return $this The command object itself