UserStatus.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2020, Georg Ehrke
  5. *
  6. * @author Georg Ehrke <oc.list@georgehrke.com>
  7. *
  8. * @license GNU AGPL version 3 or any later version
  9. *
  10. * This program is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License as
  12. * published by the Free Software Foundation, either version 3 of the
  13. * License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. */
  24. namespace OCA\UserStatus\Db;
  25. use OCP\AppFramework\Db\Entity;
  26. /**
  27. * Class UserStatus
  28. *
  29. * @package OCA\UserStatus\Db
  30. *
  31. * @method int getId()
  32. * @method void setId(int $id)
  33. * @method string getUserId()
  34. * @method void setUserId(string $userId)
  35. * @method string getStatus()
  36. * @method void setStatus(string $status)
  37. * @method int getStatusTimestamp()
  38. * @method void setStatusTimestamp(int $statusTimestamp)
  39. * @method bool getIsUserDefined()
  40. * @method void setIsUserDefined(bool $isUserDefined)
  41. * @method string|null getMessageId()
  42. * @method void setMessageId(string|null $messageId)
  43. * @method string|null getCustomIcon()
  44. * @method void setCustomIcon(string|null $customIcon)
  45. * @method string|null getCustomMessage()
  46. * @method void setCustomMessage(string|null $customMessage)
  47. * @method int|null getClearAt()
  48. * @method void setClearAt(int|null $clearAt)
  49. * @method setIsBackup(bool $isBackup): void
  50. * @method getIsBackup(): bool
  51. * @method int getStatusMessageTimestamp()
  52. * @method void setStatusMessageTimestamp(int $statusTimestamp)
  53. */
  54. class UserStatus extends Entity {
  55. /** @var string */
  56. public $userId;
  57. /** @var string */
  58. public $status;
  59. /** @var int */
  60. public $statusTimestamp;
  61. /** @var boolean */
  62. public $isUserDefined;
  63. /** @var string|null */
  64. public $messageId;
  65. /** @var string|null */
  66. public $customIcon;
  67. /** @var string|null */
  68. public $customMessage;
  69. /** @var int|null */
  70. public $clearAt;
  71. /** @var bool $isBackup */
  72. public $isBackup;
  73. /** @var int */
  74. protected $statusMessageTimestamp = 0;
  75. public function __construct() {
  76. $this->addType('userId', 'string');
  77. $this->addType('status', 'string');
  78. $this->addType('statusTimestamp', 'int');
  79. $this->addType('isUserDefined', 'boolean');
  80. $this->addType('messageId', 'string');
  81. $this->addType('customIcon', 'string');
  82. $this->addType('customMessage', 'string');
  83. $this->addType('clearAt', 'int');
  84. $this->addType('isBackup', 'boolean');
  85. $this->addType('statusMessageTimestamp', 'int');
  86. }
  87. }