namespace OCA\FilesReminders\Model;
+use DateTimeInterface;
+use JsonSerializable;
use OCA\FilesReminders\Db\Reminder;
use OCA\FilesReminders\Exception\NodeNotFoundException;
use OCP\Files\IRootFolder;
use OCP\Files\Node;
-class RichReminder extends Reminder {
+class RichReminder extends Reminder implements JsonSerializable {
public function __construct(
private Reminder $reminder,
private IRootFolder $root,
public function __call(string $methodName, array $args) {
return $this->reminder->__call($methodName, $args);
}
+
+ public function jsonSerialize(): array {
+ return [
+ 'userId' => $this->getUserId(),
+ 'fileId' => $this->getFileId(),
+ 'remindAt' => $this->getRemindAt()->format(DateTimeInterface::ATOM), // ISO 8601
+ 'createdAt' => $this->getCreatedAt()->format(DateTimeInterface::ATOM), // ISO 8601
+ 'notified' => $this->getNotified(),
+ ];
+ }
}