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.

IAccount.php 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net>
  5. *
  6. * @author Julius Härtl <jus@bitgrid.net>
  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 OCP\Accounts;
  25. use OCP\IUser;
  26. /**
  27. * Interface IAccount
  28. *
  29. * @since 15.0.0
  30. * @package OCP\Accounts
  31. */
  32. interface IAccount extends \JsonSerializable {
  33. /**
  34. * Set a property with data
  35. *
  36. * @since 15.0.0
  37. *
  38. * @param string $property Must be one of the PROPERTY_ prefixed constants of \OCP\Accounts\IAccountManager
  39. * @param string $value
  40. * @param string $scope Must be one of the VISIBILITY_ prefixed constants of \OCP\Accounts\IAccountManager
  41. * @param string $verified \OCP\Accounts\IAccountManager::NOT_VERIFIED | \OCP\Accounts\IAccountManager::VERIFICATION_IN_PROGRESS | \OCP\Accounts\IAccountManager::VERIFIED
  42. * @return IAccount
  43. */
  44. public function setProperty(string $property, string $value, string $scope, string $verified): IAccount;
  45. /**
  46. * Get a property by its key
  47. *
  48. * @since 15.0.0
  49. *
  50. * @param string $property Must be one of the PROPERTY_ prefixed constants of \OCP\Accounts\IAccountManager
  51. * @return IAccountProperty
  52. * @throws PropertyDoesNotExistException
  53. */
  54. public function getProperty(string $property): IAccountProperty;
  55. /**
  56. * Get all properties of an account
  57. *
  58. * @since 15.0.0
  59. *
  60. * @return IAccountProperty[]
  61. */
  62. public function getProperties(): array;
  63. /**
  64. * Get all properties that match the provided filters for scope and verification status
  65. *
  66. * @since 15.0.0
  67. *
  68. * @param string $scope Must be one of the VISIBILITY_ prefixed constants of \OCP\Accounts\IAccountManager
  69. * @param string $verified \OCP\Accounts\IAccountManager::NOT_VERIFIED | \OCP\Accounts\IAccountManager::VERIFICATION_IN_PROGRESS | \OCP\Accounts\IAccountManager::VERIFIED
  70. * @return IAccountProperty[]
  71. */
  72. public function getFilteredProperties(string $scope = null, string $verified = null): array;
  73. /**
  74. * Get the related user for the account data
  75. *
  76. * @since 15.0.0
  77. *
  78. * @return IUser
  79. */
  80. public function getUser(): IUser;
  81. }