/
kev
/
Nextcloud_File-Changes-Tracker
Обзор
Документация
Войти
/
kev
/
Nextcloud_File-Changes-Tracker
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
lib/Db/NotificationSettings.php
82 строки
3 KB
Evgeny Konovalov
first_commit
16 фев 2026, 17:45
16 фев 2026, 17:45
476f06c
Код
Авторство
О чём код?
<?php declare(strict_types=1); namespace OCA\FileChangesTracker\Db; use OCP\AppFramework\Db\Entity; /** * Настройки уведомлений для папки * * @method int getFolderConfigId() * @method void setFolderConfigId(int $folderConfigId) * @method bool getInstantNotifications() * @method void setInstantNotifications(bool $instantNotifications) * @method bool getNotifyOnCreate() * @method void setNotifyOnCreate(bool $notifyOnCreate) * @method bool getNotifyOnModify() * @method void setNotifyOnModify(bool $notifyOnModify) * @method bool getNotifyOnDelete() * @method void setNotifyOnDelete(bool $notifyOnDelete) * @method bool getNotifyOnRename() * @method void setNotifyOnRename(bool $notifyOnRename) * @method bool getDailyDigestEnabled() * @method void setDailyDigestEnabled(bool $dailyDigestEnabled) * @method string getDigestTime() * @method void setDigestTime(string $digestTime) * @method string|null getDigestEmail() * @method void setDigestEmail(?string $digestEmail) * @method string getCreatedAt() * @method void setCreatedAt(string $createdAt) * @method string getUpdatedAt() * @method void setUpdatedAt(string $updatedAt) */ class NotificationSettings extends Entity { protected $folderConfigId; protected $instantNotifications; protected $notifyOnCreate; protected $notifyOnModify; protected $notifyOnDelete; protected $notifyOnRename; protected $dailyDigestEnabled; protected $digestTime; protected $digestEmail; protected $createdAt; protected $updatedAt; public function __construct() { $this->addType('folderConfigId', 'integer'); $this->addType('instantNotifications', 'boolean'); $this->addType('notifyOnCreate', 'boolean'); $this->addType('notifyOnModify', 'boolean'); $this->addType('notifyOnDelete', 'boolean'); $this->addType('notifyOnRename', 'boolean'); $this->addType('dailyDigestEnabled', 'boolean'); $this->addType('digestTime', 'string'); $this->addType('digestEmail', 'string'); $this->addType('createdAt', 'string'); $this->addType('updatedAt', 'string'); } /** * Сериализация для JSON ответа * Обеспечивает правильную конвертацию boolean значений */ public function jsonSerialize(): array { return [ 'id' => $this->id, 'folderConfigId' => (int) $this->folderConfigId, 'instantNotifications' => (bool) $this->instantNotifications, 'notifyOnCreate' => (bool) $this->notifyOnCreate, 'notifyOnModify' => (bool) $this->notifyOnModify, 'notifyOnDelete' => (bool) $this->notifyOnDelete, 'notifyOnRename' => (bool) $this->notifyOnRename, 'dailyDigestEnabled' => (bool) $this->dailyDigestEnabled, 'digestTime' => (string) $this->digestTime, 'digestEmail' => $this->digestEmail, 'createdAt' => $this->createdAt, 'updatedAt' => $this->updatedAt, ]; } }