From 7a80ec9026b083b4ecdf04b58235b616e6fde1f5 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 9 Mar 2015 16:15:29 +0100 Subject: [PATCH] Allow getting *all* share entries owned by a user --- lib/private/share/share.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/private/share/share.php b/lib/private/share/share.php index 4753f6ecbfa5..1c87f5d709a6 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -2368,4 +2368,16 @@ public static function getExpireInterval() { return (int)\OCP\Config::getAppValue('core', 'shareapi_expire_after_n_days', '7'); } + /** + * Get all share entries, including non-unique group items + * + * @param string $owner + * @return array + */ + public static function getAllSharesForOwner($owner) { + $query = 'SELECT * FROM *PREFIX*share WHERE `uid_owner` = ?'; + $result = \OC::$server->getDatabaseConnection()->executeQuery($query, [$owner]); + return $result->fetchAll(); + } + }