1
0

RootCollection.php 889 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2017 ownCloud GmbH
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\DAV\Avatars;
  8. use OCP\IAvatarManager;
  9. use Sabre\DAVACL\AbstractPrincipalCollection;
  10. class RootCollection extends AbstractPrincipalCollection {
  11. /**
  12. * This method returns a node for a principal.
  13. *
  14. * The passed array contains principal information, and is guaranteed to
  15. * at least contain a uri item. Other properties may or may not be
  16. * supplied by the authentication backend.
  17. *
  18. * @param array $principalInfo
  19. * @return AvatarHome
  20. */
  21. public function getChildForPrincipal(array $principalInfo) {
  22. $avatarManager = \OC::$server->get(IAvatarManager::class);
  23. return new AvatarHome($principalInfo, $avatarManager);
  24. }
  25. public function getName() {
  26. return 'avatars';
  27. }
  28. }