0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-03-13 07:53:51 +00:00
nextcloud_server/apps/dav/lib/Avatars/RootCollection.php
Andrew Summers 7a887b4513 Refactor OC\Server::getAvatarManager in dav app
Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
2024-05-30 14:14:58 +02:00

32 lines
889 B
PHP

<?php
/**
* SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2017 ownCloud GmbH
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Avatars;
use OCP\IAvatarManager;
use Sabre\DAVACL\AbstractPrincipalCollection;
class RootCollection extends AbstractPrincipalCollection {
/**
* This method returns a node for a principal.
*
* The passed array contains principal information, and is guaranteed to
* at least contain a uri item. Other properties may or may not be
* supplied by the authentication backend.
*
* @param array $principalInfo
* @return AvatarHome
*/
public function getChildForPrincipal(array $principalInfo) {
$avatarManager = \OC::$server->get(IAvatarManager::class);
return new AvatarHome($principalInfo, $avatarManager);
}
public function getName() {
return 'avatars';
}
}