public function forAll(Closure $p)
{
foreach ($this->elements as $key => $element) {
if (!$p($key, $element)) {
return false;
}
}
return true;
}
/** * {@inheritdoc} */ public function getNotificationEmails() { $emails = []; $this->businessUnits->forAll(function (BusinessUnit $bu) use(&$emails) { $emails = array_merge($emails, $bu->getNotificationEmails()); }); return new ArrayCollection($emails); }