getting a QueryInterface error

Hi, well im getting this error “The “query” property must be an instance of a class that implements the QueryInterface” with this code, i know that it should be easy to solve but im new in yii2 and active record, if you can please tell me what im doing wrong , ive looking for an answer for the last three days :( , a guy asked for the same problem few days ago but no one helped him

    $query = Place::findAll([1,2,3]);





    $dataProvider = new ActiveDataProvider([


        'query' => $query,


    ]);





    if (!($this->load($params) && $this->validate())) {


        return $dataProvider;


    }





    $query->andFilterWhere([


        'id' => $this->id,


    ]);


    .


    .








    return $dataProvider;


}

What the error says is that the ‘query’ property of ActiveDataProvider should be “an instance of a class that implements the QueryInterface.”

The fact that the error has been thrown means that you are passing to it something else.

You’re passing


Place::findAll([1,2,3]);

which returns a list of active record models…, not an "instance of a class that implements the QueryInterface."

You should be using


Place::find()

instead of


Place::findAll()

with ActiveDataProvider