From badd2908b79967b6018810fdfaa77a894fe037c7 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Tue, 16 Oct 2012 15:38:52 -0400 Subject: [PATCH] Add unshareAll() function to Share API --- lib/public/share.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/public/share.php b/lib/public/share.php index 1db3a0b2c1d..ccc1842f813 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -326,6 +326,20 @@ class Share { return false; } + /** + * @brief Unshare an item from all users, groups, and remove all links + * @param string Item type + * @param string Item source + * @return Returns true on success or false on failure + */ + public static function unshareAll($itemType, $itemSource) { + if ($item = self::getItemShared($itemType, $itemSource)) { + self::delete($item['id']); + return true; + } + return false; + } + /** * @brief Unshare an item shared with the current user * @param string Item type