This line was compatible with the interfaces before, but now requires a specific implementation:
cc @developeruz
We should add an instanceof check there.
ActiveQueryInterface::asArray() should be used at that line instead of createCommand() usage.
select() is also not provided by some implementations such as redis.
@klimov-paul asArray() does not prevent afterFind(). See https://github.com/yiisoft/yii2/issues/13453
@samdark afterFind() is not called on an array...
Right.
select() can be avoided at all
it was added for optimization.
I have noticed
Still, either it should belong QueryInterface or removed from validator.
check for $query instanceof \yii\db\ActiveQuery can be done. I am working on a solution.
$query always instanceof ActiveQuery or not?
@developeruz nope https://github.com/yiisoft/yii2-mongodb/blob/master/ActiveQuery.php
That's active query but not DB active query.
@developeruz no, it can be an instance of mongodb, elasticsearch or redis query. the only thing they have in common is ActiveQueryInterface.
The fix looks good to me.
It is good but it is not enough. I am working on tests for redis and elasticsearch.
@developeruz I have included your fix in #13487. Thank you!