db\QueryInterface count()

count() public abstract method Returns the number of records. public abstract integer count ( $q = '*', $db = null )$q string The COUNT expression. Defaults to '*'. $db yii\db\Connection The database connection used to execute the query. If this parameter is not given, the db application component will be used. return integer Number of records.

db\QueryInterface andWhere()

andWhere() public abstract method Adds an additional WHERE condition to the existing one. The new condition and the existing one will be joined using the 'AND' operator. See also: where() orWhere() public abstract $this andWhere ( $condition )$condition string|array The new WHERE condition. Please refer to where() on how to specify this parameter. return $this The query object itself

db\QueryInterface andFilterWhere()

andFilterWhere() public abstract method Adds an additional WHERE condition to the existing one ignoring empty parameters. The new condition and the existing one will be joined using the 'AND' operator. See also: filterWhere() orFilterWhere() public abstract $this andFilterWhere ( array $condition )$condition array The new WHERE condition. Please refer to where() on how to specify this parameter. return $this The query object itself

db\QueryInterface all()

all() public abstract method Executes the query and returns all results as an array. public abstract array all ( $db = null )$db yii\db\Connection The database connection used to execute the query. If this parameter is not given, the db application component will be used. return array The query results. If the query results in nothing, an empty array will be returned.

db\QueryInterface addOrderBy()

addOrderBy() public abstract method Adds additional ORDER BY columns to the query. See also orderBy(). public abstract $this addOrderBy ( $columns )$columns string|array The columns (and the directions) to be ordered by. Columns can be specified in either a string (e.g. "id ASC, name DESC") or an array (e.g. ['id' => SORT_ASC, 'name' => SORT_DESC]). The method will automatically quote the column names unless a column contains some parenthesis (which means the column contains a DB

db\QueryBuilder __construct()

__construct() public method Constructor. public void __construct ( $connection, $config = [] )$connection yii\db\Connection The database connection. $config array Name-value pairs that will be used to initialize the object properties

db\QueryBuilder update()

update() public method Creates an UPDATE SQL statement. For example, $params = []; $sql = $queryBuilder->update('user', ['status' => 1], 'age > 30', $params); The method will properly escape the table and column names. public string update ( $table, $columns, $condition, &$params )$table string The table to be updated. $columns array The column data (name => value) to be updated. $condition array|string The condition that will be put in the WHERE part. Please refer

db\QueryBuilder truncateTable()

truncateTable() public method Builds a SQL statement for truncating a DB table. public string truncateTable ( $table )$table string The table to be truncated. The name will be properly quoted by the method. return string The SQL statement for truncating a DB table.

db\QueryBuilder selectExists()

selectExists() public method (available since version 2.0.8) Creates a SELECT EXISTS() SQL statement. public string selectExists ( $rawSql )$rawSql string The subquery in a raw form to select from. return string The SELECT EXISTS() SQL statement.

db\QueryBuilder resetSequence()

resetSequence() public method Creates a SQL statement 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 string resetSequence ( $table, $value = null )$table string The name of the table whose primary key sequence will be reset $value array|string The value for the primary key of the next new row inserted. If this is not set, the next new row's primary