db\QueryTrait filterWhere()

filterWhere() public method Sets the WHERE part of the query but ignores empty operands. This method is similar to where(). The main difference is that this method will remove empty query operands. As a result, this method is best suited for building query conditions based on filter values entered by users. The following code shows the difference between this method and where(): // WHERE `age`=:age $query->filterWhere(['name' => null, 'age' => 20]); // WHERE `age`=:age $query->w

db\QueryTrait filterCondition()

filterCondition() protected method Removes empty operands from the given query condition. protected array filterCondition ( $condition )$condition array The original condition return array The condition with empty operands removed. throws yii\base\NotSupportedException if the condition operator is not supported

db\QueryTrait andWhere()

andWhere() public 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 $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\QueryTrait andFilterWhere()

andFilterWhere() public method Adds an additional WHERE condition to the existing one but ignores empty operands. The new condition and the existing one will be joined using the 'AND' operator. This method is similar to andWhere(). The main difference is that this method will remove empty query operands. As a result, this method is best suited for building query conditions based on filter values entered by users. See also: filterWhere() orFilterWhere() public $this andFilterWhere ( array

db\QueryTrait addOrderBy()

addOrderBy() public method Adds additional ORDER BY columns to the query. See also orderBy(). public $this addOrderBy ( $columns )$columns string|array|yii\db\Expression 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\QueryTrait $where

$where public property Query condition. This refers to the WHERE clause in a SQL statement. For example, ['age' => 31, 'team' => 1]. See also where() for valid syntax on specifying this value. public string|array $where = null

db\QueryTrait $orderBy

$orderBy public property How to sort the query results. This is used to construct the ORDER BY clause in a SQL statement. The array keys are the columns to be sorted by, and the array values are the corresponding sort directions which can be either SORT_ASC or SORT_DESC. The array may also contain yii\db\Expression objects. If that is the case, the expressions will be converted into strings without any change. public array $orderBy = null

db\QueryTrait $offset

$offset public property Zero-based offset from where the records are to be returned. If not set or less than 0, it means starting from the beginning. public integer $offset = null

db\QueryTrait $limit

$limit public property Maximum number of records to be returned. If not set or less than 0, it means no limit. public integer $limit = null

db\QueryTrait $indexBy

$indexBy public property The name of the column by which the query results should be indexed by. This can also be a callable (e.g. anonymous function) that returns the index value based on the given row data. For more details, see indexBy(). This property is only used by all(). public string|callable $indexBy = null