1
votes

I've searched the information and checked the documentation according to this, but it's still not clear to me what andFilterWhere() condition 2nd operand does.

According to the documentation, it says:

operand 2 be a string or an array representing the values that the column or DB expression should be like. For example, ['like', 'name', 'tester']

But it's still not clear to me. Could someone explain me more about it?

1

1 Answers

3
votes

If you use it as a 3 elements array:

['like', 'name', 'tester']
  • First param like is operand, which will be used in query to create like query (it can be =, != etc.)
  • Second param name is column name in your DB table.

  • Third param is value to compare, for example user input.

If you use it as key => value:

['name' => $this->name]
  • Key name is column name in your DB table
  • Value $this->name is property of your model, where youre holding user input.