Hello i have question about Yii2 has many.
My table structure :
-------------------------
----col1------col2-------
------3---------4--------
------4---------1--------
and now i have method in my Model class:
getCols(){
return $this->hasMany(Cols::className,['col1'=>'id']);
}
and now i want to get all records where for example col1 = 4 or col2 = 4, so how can i set or statement ? I know that i can do
getCols(){
return $this->hasMany(Cols::className,['col1'=>'id','col2'=>'id']);
}
but this method returns me records for example where col1 = 4 AND col2 = 4
Greetings