Answer the question
In order to leave comments, you need to log in
How to search by objects in Yii2 array?
The question is this: I have an array with objects, I need to do a search by objects so as not to make a request to the database every time
// hasMany
$list = $user->getList()->all();
Answer the question
In order to leave comments, you need to log in
and than usual where does not approach?$list = $user->getList()->where(['id'=>2])->all();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question