Pesquisa de PHP no objeto. variedade
$neededObject = array_filter(
$arrayOfObjects,
function ($e) use (&$searchedValue) {
return $e->id == $searchedValue;
}
);
Gleaming Gannet