UserStatus.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\UserStatus\Db;
  8. use OCP\AppFramework\Db\Entity;
  9. use OCP\DB\Types;
  10. /**
  11. * Class UserStatus
  12. *
  13. * @package OCA\UserStatus\Db
  14. *
  15. * @method int getId()
  16. * @method void setId(int $id)
  17. * @method string getUserId()
  18. * @method void setUserId(string $userId)
  19. * @method string getStatus()
  20. * @method void setStatus(string $status)
  21. * @method int getStatusTimestamp()
  22. * @method void setStatusTimestamp(int $statusTimestamp)
  23. * @method bool getIsUserDefined()
  24. * @method void setIsUserDefined(bool $isUserDefined)
  25. * @method string|null getMessageId()
  26. * @method void setMessageId(string|null $messageId)
  27. * @method string|null getCustomIcon()
  28. * @method void setCustomIcon(string|null $customIcon)
  29. * @method string|null getCustomMessage()
  30. * @method void setCustomMessage(string|null $customMessage)
  31. * @method int|null getClearAt()
  32. * @method void setClearAt(int|null $clearAt)
  33. * @method setIsBackup(bool $isBackup): void
  34. * @method getIsBackup(): bool
  35. * @method int getStatusMessageTimestamp()
  36. * @method void setStatusMessageTimestamp(int $statusTimestamp)
  37. */
  38. class UserStatus extends Entity {
  39. /** @var string */
  40. public $userId;
  41. /** @var string */
  42. public $status;
  43. /** @var int */
  44. public $statusTimestamp;
  45. /** @var boolean */
  46. public $isUserDefined;
  47. /** @var string|null */
  48. public $messageId;
  49. /** @var string|null */
  50. public $customIcon;
  51. /** @var string|null */
  52. public $customMessage;
  53. /** @var int|null */
  54. public $clearAt;
  55. /** @var bool $isBackup */
  56. public $isBackup;
  57. /** @var int */
  58. protected $statusMessageTimestamp = 0;
  59. public function __construct() {
  60. $this->addType('userId', 'string');
  61. $this->addType('status', 'string');
  62. $this->addType('statusTimestamp', Types::INTEGER);
  63. $this->addType('isUserDefined', 'boolean');
  64. $this->addType('messageId', 'string');
  65. $this->addType('customIcon', 'string');
  66. $this->addType('customMessage', 'string');
  67. $this->addType('clearAt', Types::INTEGER);
  68. $this->addType('isBackup', 'boolean');
  69. $this->addType('statusMessageTimestamp', Types::INTEGER);
  70. }
  71. }