public function getAlarmById(int $id): AlarmInterface
    {
        $alarms = $this->getAlarms();
        foreach ($alarms as $alarm) {
            if ($alarm->getId() === $id) {
                return $alarm;
            }
        }

        throw new NotFoundException("Unable to find an alarm with the id {$id} on this network");
    }
public function getAlarmById(int $id): AlarmInterface
    {
        $alarms = $this->getAlarms();
        foreach ($alarms as $alarm) {
            if ($alarm->getId() === $id) {
                return $alarm;
            }
        }

        throw new NotFoundException("Unable to find an alarm with the id {$id} on this network");
    }
public function getAlarmById ( int $ id ) : AlarmInterface { $ alarms = $ this -> getAlarms ( ) ; foreach ( $ alarms as $ alarm ) { if ( $ alarm -> getId ( ) === $ id ) { return $ alarm ; } } throw new NotFoundException ( "Unable to find an alarm with the id {$id} on this network" ) ; }
Get the alarm from the specified id.

@param int $id The ID of the alarm

@return AlarmInterface
Get the alarm from the specified id .