duncan3dc\Sonos\Network::getSpeakerByRoom PHP Метод

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

Get a speaker with the specified room name.
public getSpeakerByRoom ( string $room ) : duncan3dc\Sonos\Speaker | null
$room string The name of the room to look for
Результат duncan3dc\Sonos\Speaker | null
    public function getSpeakerByRoom($room)
    {
        $speakers = $this->getSpeakers();
        foreach ($speakers as $speaker) {
            if ($speaker->room === $room) {
                return $speaker;
            }
        }
    }