summaryrefslogtreecommitdiffstats
path: root/lib/private/Share20/DefaultShareProvider.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Share20/DefaultShareProvider.php')
-rw-r--r--lib/private/Share20/DefaultShareProvider.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php
index aea50dfcdb6..05b3094e6a2 100644
--- a/lib/private/Share20/DefaultShareProvider.php
+++ b/lib/private/Share20/DefaultShareProvider.php
@@ -1382,4 +1382,30 @@ class DefaultShareProvider implements IShareProvider {
}
}
+
+ public function getAllShares(): iterable {
+ $qb = $this->dbConn->getQueryBuilder();
+
+ $qb->select('*')
+ ->from('share')
+ ->where(
+ $qb->expr()->orX(
+ $qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share\IShare::TYPE_USER)),
+ $qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share\IShare::TYPE_GROUP)),
+ $qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share\IShare::TYPE_LINK))
+ )
+ );
+
+ $cursor = $qb->execute();
+ while($data = $cursor->fetch()) {
+ try {
+ $share = $this->createShare($data);
+ } catch (InvalidShare $e) {
+ continue;
+ }
+
+ yield $share;
+ }
+ $cursor->closeCursor();
+ }
}