S
S
shoxabbos Olimjonov2016-11-28 09:24:10
Yii
shoxabbos Olimjonov, 2016-11-28 09:24:10

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

1 answer(s)
M
Maxim Fedorov, 2016-11-28
@shoxabbos1994

and than usual where does not approach?
$list = $user->getList()->where(['id'=>2])->all();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question