IAvatarManager.php 871 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  6. * SPDX-License-Identifier: AGPL-3.0-only
  7. */
  8. namespace OCP;
  9. /**
  10. * This class provides avatar functionality
  11. * @since 6.0.0
  12. */
  13. interface IAvatarManager {
  14. /**
  15. * Return a user specific instance of \OCP\IAvatar
  16. * @see IAvatar
  17. * @param string $userId the Nextcloud user id
  18. * @throws \Exception In case the username is potentially dangerous
  19. * @throws \OCP\Files\NotFoundException In case there is no user folder yet
  20. * @since 6.0.0
  21. */
  22. public function getAvatar(string $userId): IAvatar;
  23. /**
  24. * Returns a guest user avatar instance.
  25. *
  26. * @param string $name The guest name, e.g. "Albert".
  27. * @return IAvatar
  28. * @since 16.0.0
  29. */
  30. public function getGuestAvatar(string $name): IAvatar;
  31. }