notificationId = $notification->getId(); if ($addressee instanceof User) { $this->userId = $addressee->getId(); $this->userGroupId = null; } else { $this->userGroupId = $addressee->getId(); $this->userId = null; } } public function getNotificationId(): int { return $this->notificationId; } public function getUserId(): ?int { return $this->userId; } public function getUserGroupId(): ?int { return $this->userGroupId; } }