本文整理匯總了PHP中OCA\Files_Sharing\Helper::getSharesFromItem方法的典型用法代碼示例。如果您正苦於以下問題:PHP Helper::getSharesFromItem方法的具體用法?PHP Helper::getSharesFromItem怎麽用?PHP Helper::getSharesFromItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OCA\Files_Sharing\Helper
的用法示例。
在下文中一共展示了Helper::getSharesFromItem方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: correctFolders
/**
* Correct the parent folders' ETags for all users shared the file at $target
*
* @param string $target
*/
public static function correctFolders($target)
{
// ignore part files
if (pathinfo($target, PATHINFO_EXTENSION) === 'part') {
return false;
}
// Correct Shared folders of other users shared with
$shares = \OCA\Files_Sharing\Helper::getSharesFromItem($target);
foreach ($shares as $share) {
if ((int) $share['share_type'] === \OCP\Share::SHARE_TYPE_USER) {
self::correctUsersFolder($share['share_with'], $share['file_target']);
} elseif ((int) $share['share_type'] === \OCP\Share::SHARE_TYPE_GROUP) {
$users = \OC_Group::usersInGroup($share['share_with']);
foreach ($users as $user) {
self::correctUsersFolder($user, $share['file_target']);
}
} else {
//unique name for group share
self::correctUsersFolder($share['share_with'], $share['file_target']);
}
}
}