2023-09-27 05:41:20 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2023-09-27 05:41:20 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace OC\User;
|
|
|
|
|
|
|
|
|
|
use OCP\IUser;
|
|
|
|
|
use OCP\User\IOutOfOfficeData;
|
|
|
|
|
|
|
|
|
|
class OutOfOfficeData implements IOutOfOfficeData {
|
|
|
|
|
public function __construct(private string $id,
|
|
|
|
|
private IUser $user,
|
|
|
|
|
private int $startDate,
|
|
|
|
|
private int $endDate,
|
|
|
|
|
private string $shortMessage,
|
2024-06-10 10:30:53 -04:00
|
|
|
private string $message,
|
2024-07-03 04:47:59 -04:00
|
|
|
private ?string $replacementUserId,
|
|
|
|
|
private ?string $replacementUserDisplayName) {
|
2023-09-27 05:41:20 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getId(): string {
|
|
|
|
|
return $this->id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getUser(): IUser {
|
|
|
|
|
return $this->user;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getStartDate(): int {
|
|
|
|
|
return $this->startDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getEndDate(): int {
|
|
|
|
|
return $this->endDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getShortMessage(): string {
|
|
|
|
|
return $this->shortMessage;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getMessage(): string {
|
|
|
|
|
return $this->message;
|
|
|
|
|
}
|
2023-12-01 04:46:16 -05:00
|
|
|
|
2024-07-03 04:47:59 -04:00
|
|
|
public function getReplacementUserId(): ?string {
|
2024-06-10 10:30:53 -04:00
|
|
|
return $this->replacementUserId;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-03 04:47:59 -04:00
|
|
|
public function getReplacementUserDisplayName(): ?string {
|
2024-06-10 10:30:53 -04:00
|
|
|
return $this->replacementUserDisplayName;
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-01 04:46:16 -05:00
|
|
|
public function jsonSerialize(): array {
|
|
|
|
|
return [
|
|
|
|
|
'id' => $this->getId(),
|
|
|
|
|
'userId' => $this->getUser()->getUID(),
|
|
|
|
|
'startDate' => $this->getStartDate(),
|
|
|
|
|
'endDate' => $this->getEndDate(),
|
|
|
|
|
'shortMessage' => $this->getShortMessage(),
|
|
|
|
|
'message' => $this->getMessage(),
|
2024-06-10 10:30:53 -04:00
|
|
|
'replacementUserId' => $this->getReplacementUserId(),
|
|
|
|
|
'replacementUserDisplayName' => $this->getReplacementUserDisplayName(),
|
2023-12-01 04:46:16 -05:00
|
|
|
];
|
|
|
|
|
}
|
2023-09-27 05:41:20 -04:00
|
|
|
}
|