summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2016-08-10 14:56:41 +0200
committerGitHub <noreply@github.com>2016-08-10 14:56:41 +0200
commit219f36d2616126684f34372e36f3c76355a78aa7 (patch)
tree4a70cbac1c92b4899a5d055161f541eb87d454a6 /apps/files_sharing/lib
parente8571a2b196b6f255ae05e5c13d544593628defa (diff)
parenta999420c7561791a30ac05ac389876f45aa6c11b (diff)
downloadnextcloud-server-219f36d2616126684f34372e36f3c76355a78aa7.tar.gz
nextcloud-server-219f36d2616126684f34372e36f3c76355a78aa7.zip
Merge pull request #820 from nextcloud/shared-storage-lazy-numeric-id
get shared storage storage id without setting up the storage
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/SharedMount.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/SharedMount.php b/apps/files_sharing/lib/SharedMount.php
index 57610db9076..d160eb24228 100644
--- a/apps/files_sharing/lib/SharedMount.php
+++ b/apps/files_sharing/lib/SharedMount.php
@@ -235,4 +235,17 @@ class SharedMount extends MountPoint implements MoveableMount {
public function getStorageRootId() {
return $this->getShare()->getNodeId();
}
+
+ /**
+ * @return int
+ */
+ public function getNumericStorageId() {
+ $builder = \OC::$server->getDatabaseConnection()->getQueryBuilder();
+
+ $query = $builder->select('storage')
+ ->from('filecache')
+ ->where($builder->expr()->eq('fileid', $builder->createNamedParameter($this->getShare()->getNodeId())));
+
+ return $query->execute()->fetchColumn();
+ }
}