/** * Get the speaker of the alarm. * * @return Speaker */ public function getSpeaker() { foreach ($this->network->getSpeakers() as $speaker) { if ($speaker->getUuid() === $this->getRoom()) { return $speaker; } } throw new \RuntimeException("Unable to find a speaker for this alarm"); }
/** * Get the speakers that are in the group of this controller. * * @return Speaker[] */ public function getSpeakers() { $group = []; $speakers = $this->network->getSpeakers(); foreach ($speakers as $speaker) { if ($speaker->getGroup() === $this->getGroup()) { $group[] = $speaker; } } return $group; }