You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
970 B

  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\Talk\Model;
  8. use OCP\AppFramework\Db\Entity;
  9. use OCP\DB\Types;
  10. /**
  11. * @method void setBotId(int $botId)
  12. * @method int getBotId()
  13. * @method void setToken(string $token)
  14. * @method string getToken()
  15. * @method void setState(int $state)
  16. * @method int getState()
  17. */
  18. class BotConversation extends Entity implements \JsonSerializable {
  19. protected int $botId = 0;
  20. protected string $token = '';
  21. protected int $state = Bot::STATE_DISABLED;
  22. public function __construct() {
  23. $this->addType('bot_id', Types::BIGINT);
  24. $this->addType('token', Types::STRING);
  25. $this->addType('state', Types::SMALLINT);
  26. }
  27. public function jsonSerialize(): array {
  28. return [
  29. 'id' => $this->getId(),
  30. 'bot_id' => $this->getBotId(),
  31. 'token' => $this->getToken(),
  32. 'state' => $this->getState(),
  33. ];
  34. }
  35. }