From a999420c7561791a30ac05ac389876f45aa6c11b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 9 Aug 2016 15:52:13 +0200 Subject: get shared storage storage id without setting up the storage --- apps/files_sharing/lib/SharedMount.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'apps') 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(); + } } -- cgit v1.2.3