yii\db\QueryInterface::andFilterWhere PHP Method

andFilterWhere() public method

The new condition and the existing one will be joined using the 'AND' operator.
See also: filterWhere()
See also: orFilterWhere()
public andFilterWhere ( array $condition )
$condition array the new WHERE condition. Please refer to [[where()]] on how to specify this parameter.
    public function andFilterWhere(array $condition);

Usage Example

 /**
  * 
  * @param QueryInterface $query
  * @param string $attribute name of defined public property
  * @param string $fieldName related table's field name
  * @param string $tableName table name or alias (if defined in `joinWithRelation()` method)
  * @param string $operator defaults to 'like'
  */
 public function addRelationFilter(&$query, $attribute, $fieldName, $tableName, $operator = 'like')
 {
     $query->andFilterWhere([$operator, $this->getRelationSearchTableName($tableName, $attribute) . '.' . $fieldName, $this->{$attribute}]);
 }
All Usage Examples Of yii\db\QueryInterface::andFilterWhere