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();
+ }
}
*/
public function getStorageId() {
if (!$this->storageId) {
- $storage = $this->mount->getStorage();
- if (!$storage) {
- return -1;
- }
- $this->storageId = $storage->getStorageCache()->getNumericId();
+ $this->storageId = $this->mount->getNumericStorageId();
}
return parent::getStorageId();
}
return $this->storageId;
}
+ /**
+ * @return int
+ */
+ public function getNumericStorageId() {
+ return $this->getStorage()->getStorageCache()->getNumericId();
+ }
+
/**
* @param string $path
* @return string
*/
public function getStorageId();
+ /**
+ * Get the id of the storages
+ *
+ * @return int
+ * @since 9.1.0
+ */
+ public function getNumericStorageId();
+
/**
* Get the path relative to the mountpoint
*