From 1dbe7dafe26f4a11af610f3ce0dea59c31227d78 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 5 Apr 2022 20:21:02 +0200 Subject: Fetch status in heartbeat controller only once Store the user status inside the event instead of fetching it again Signed-off-by: Carl Schwan --- apps/user_status/lib/Connector/UserStatus.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'apps/user_status/lib/Connector') diff --git a/apps/user_status/lib/Connector/UserStatus.php b/apps/user_status/lib/Connector/UserStatus.php index 26dc2be7e93..ff05ded9e2b 100644 --- a/apps/user_status/lib/Connector/UserStatus.php +++ b/apps/user_status/lib/Connector/UserStatus.php @@ -46,12 +46,11 @@ class UserStatus implements IUserStatus { /** @var DateTimeImmutable|null */ private $clearAt; - /** - * UserStatus constructor. - * - * @param Db\UserStatus $status - */ + /** @var Db\UserStatus */ + private $internalStatus; + public function __construct(Db\UserStatus $status) { + $this->internalStatus = $status; $this->userId = $status->getUserId(); $this->status = $status->getStatus(); $this->message = $status->getCustomMessage(); @@ -99,4 +98,8 @@ class UserStatus implements IUserStatus { public function getClearAt(): ?DateTimeImmutable { return $this->clearAt; } + + public function getInternal(): Db\UserStatus { + return $this->internalStatus; + } } -- cgit v1.2.3