hello,
I’m blocking on a problem and would like to have your advises:
I try to display a grid for each user only with its own Orders.
When I do the following everything work fine:
$dataProvider = new ActiveDataProvider([
'query' => OrderOperation::find(),
'pagination' => [
'pageSize' => 5,
],
])
But when I’m trying to prefilter the dataprovider with only the orders of the users, it’s not working and get the following error : The “query” property must be an instance of a class that implements the QueryInterface e.g. yii\db\Query or its subclasses.
$dataProvider = new ActiveDataProvider([
'query' => orderOperation::find()
->where(['user_id' => $userID])
->orderBy('id')
->all(),
'pagination' => [
'pageSize' => 5,
],
])
What Am I doing wrong ?
Thx