AccessToken.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCA\OAuth2\Db;
  7. use OCP\AppFramework\Db\Entity;
  8. use OCP\DB\Types;
  9. /**
  10. * @method int getTokenId()
  11. * @method void setTokenId(int $identifier)
  12. * @method int getClientId()
  13. * @method void setClientId(int $identifier)
  14. * @method string getEncryptedToken()
  15. * @method void setEncryptedToken(string $token)
  16. * @method string getHashedCode()
  17. * @method void setHashedCode(string $token)
  18. * @method int getCodeCreatedAt()
  19. * @method void setCodeCreatedAt(int $createdAt)
  20. * @method int getTokenCount()
  21. * @method void setTokenCount(int $tokenCount)
  22. */
  23. class AccessToken extends Entity {
  24. /** @var int */
  25. protected $tokenId;
  26. /** @var int */
  27. protected $clientId;
  28. /** @var string */
  29. protected $hashedCode;
  30. /** @var string */
  31. protected $encryptedToken;
  32. /** @var int */
  33. protected $codeCreatedAt;
  34. /** @var int */
  35. protected $tokenCount;
  36. public function __construct() {
  37. $this->addType('id', Types::INTEGER);
  38. $this->addType('tokenId', Types::INTEGER);
  39. $this->addType('clientId', Types::INTEGER);
  40. $this->addType('hashedCode', 'string');
  41. $this->addType('encryptedToken', 'string');
  42. $this->addType('codeCreatedAt', Types::INTEGER);
  43. $this->addType('tokenCount', Types::INTEGER);
  44. }
  45. }