db\QueryInterface where()

where() public abstract method Sets the WHERE part of the query. The $condition specified as an array can be in one of the following two formats: hash format: ['column1' => value1, 'column2' => value2, ...] operator format: [operator, operand1, operand2, ...] A condition in hash format represents the following SQL expression in general: column1=value1 AND column2=value2 AND .... In case when a value is an array, an IN expression will be generated. And if a value is null, IS NULL wil

db\QueryInterface orWhere()

orWhere() public abstract method Adds an additional WHERE condition to the existing one. The new condition and the existing one will be joined using the 'OR' operator. See also: where() andWhere() public abstract $this orWhere ( $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 orFilterWhere()

orFilterWhere() 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 'OR' operator. See also: filterWhere() andFilterWhere() public abstract $this orFilterWhere ( 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 orderBy()

orderBy() public abstract method Sets the ORDER BY part of the query. See also addOrderBy(). public abstract $this orderBy ( $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 expression).

db\QueryInterface one()

one() public abstract method Executes the query and returns a single row of result. public abstract array|boolean one ( $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|boolean The first row (in terms of an array) of the query result. False is returned if the query results in nothing.

db\QueryInterface offset()

offset() public abstract method Sets the OFFSET part of the query. public abstract $this offset ( $offset )$offset integer The offset. Use null or negative value to disable offset. return $this The query object itself

db\QueryInterface limit()

limit() public abstract method Sets the LIMIT part of the query. public abstract $this limit ( $limit )$limit integer The limit. Use null or negative value to disable limit. return $this The query object itself

db\QueryInterface indexBy()

indexBy() public abstract method Sets the indexBy() property. public abstract $this indexBy ( $column )$column string|callable 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. The signature of the callable should be: function ($row) { // return the index value corresponding to $row } return $this The query object itself

db\QueryInterface filterWhere()

filterWhere() public abstract method Sets the WHERE part of the query ignoring empty parameters. See also: andFilterWhere() orFilterWhere() public abstract $this filterWhere ( array $condition )$condition array The conditions that should be put in the WHERE part. Please refer to where() on how to specify this parameter. return $this The query object itself

db\QueryInterface exists()

exists() public abstract method Returns a value indicating whether the query result contains any row of data. public abstract boolean exists ( $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 boolean Whether the query result contains any row of data.