Answer the question
In order to leave comments, you need to log in
How to add a method to a class if the class cannot be overridden?
different application services return objects of different types
$searchResults
$someOtherResults
$arrayOfValueObjects
if there is no way to override them, how to make them "reduce to a common denominator"
foreach(array_merge($searchResults, $someOtherResults, $arrayOfValueObjects) as $item) {
$item->render();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question