public function getSpeakerByRoom(string $room): SpeakerInterface
    {
        $speakers = $this->getSpeakers();
        foreach ($speakers as $speaker) {
            if ($speaker->getRoom() === $room) {
                return $speaker;
            }
        }

        throw new NotFoundException("Unable to find a speaker for the room '{$room}'");
    }
public function getSpeakerByRoom(string $room): SpeakerInterface
    {
        $speakers = $this->getSpeakers();
        foreach ($speakers as $speaker) {
            if ($speaker->getRoom() === $room) {
                return $speaker;
            }
        }

        throw new NotFoundException("Unable to find a speaker for the room '{$room}'");
    }
public function getSpeakerByRoom ( string $ room ) : SpeakerInterface { $ speakers = $ this -> getSpeakers ( ) ; foreach ( $ speakers as $ speaker ) { if ( $ speaker -> getRoom ( ) === $ room ) { return $ speaker ; } } throw new NotFoundException ( "Unable to find a speaker for the room '{$room}'" ) ; }
Get a speaker with the specified room name.

@param string $room The name of the room to look for

@return SpeakerInterface
Get a speaker with the specified room name .