getSpeakers() публичный Метод

Get all the speakers on the network.
public getSpeakers ( ) : duncan3dc\Sonos\Speaker[]
Результат duncan3dc\Sonos\Speaker[]
Пример #1
0
 /**
  * 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");
 }
Пример #2
0
 /**
  * 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;
 }