diff options
author | Robin Appelman <robin@icewind.nl> | 2016-08-09 15:52:13 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2016-08-09 15:52:13 +0200 |
commit | a999420c7561791a30ac05ac389876f45aa6c11b (patch) | |
tree | 61a75d06f4cef5560732816dc518222e91a49532 /apps/files_sharing | |
parent | c04b0364acecc3b9c9bf5ee37d0e7db5b5b5234a (diff) | |
download | nextcloud-server-a999420c7561791a30ac05ac389876f45aa6c11b.tar.gz nextcloud-server-a999420c7561791a30ac05ac389876f45aa6c11b.zip |
get shared storage storage id without setting up the storage
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/SharedMount.php | 13 |
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(); + } } |