public function attachAlarm(Alarm $alarm) { $this->event->setComponent($alarm->getAlarm()); return $this; }