in my Searchmodel, I have defined boolean attributes like this:
public function rules() {
return [[['balkon_vorhanden', 'fahrstuhl_vorhanden'], 'safe']];
}
Both attributes are of datatype tyniint(1),respectively boolean.
In method search(p1,p2), I code like this:
$query->andFilterWhere([
'balkon_vorhanden' => $this->balkon_vorhanden,
'fahrstuhl_vorhanden' => $this->fahrstuhl_vorhanden
]);
This seems to be incorrect. My intention is to get records, if signal to searchmodel will be true and not to get record if signal will be false. Any ideas, how to code correct?
Coded like this and did well with it:
$query->andFilterWhere(['=', 'fahrstuhl_vorhanden', $this->fahrstuhl_vorhanden]);
$query->andFilterWhere(['=', 'balkon_vorhanden', $this->balkon_vorhanden]);