aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/files/cache/cache.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-03-27 16:43:34 +0100
committerRobin Appelman <icewind@owncloud.com>2014-03-28 15:15:56 +0100
commitf331d5f9d4a4609370bf6a5593e0720ba7c77c04 (patch)
treefdbcd0a1718713eed58a12cf48366c2aefb2bc0a /lib/private/files/cache/cache.php
parent1f6259d9c284fb917210fc438c9ff30a4549aed0 (diff)
downloadnextcloud-server-f331d5f9d4a4609370bf6a5593e0720ba7c77c04.tar.gz
nextcloud-server-f331d5f9d4a4609370bf6a5593e0720ba7c77c04.zip
Give storages the option to implement the getById behaviour for View->getPath
Diffstat (limited to 'lib/private/files/cache/cache.php')
-rw-r--r--lib/private/files/cache/cache.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php
index abc11e76470..42fee4f336d 100644
--- a/lib/private/files/cache/cache.php
+++ b/lib/private/files/cache/cache.php
@@ -597,6 +597,22 @@ class Cache {
* get the storage id of the storage for a file and the internal path of the file
*
* @param int $id
+ * @return string | null
+ */
+ public function getPathById($id) {
+ $sql = 'SELECT `path` FROM `*PREFIX*filecache` WHERE `fileid` = ? AND `storage` = ?';
+ $result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId()));
+ if ($row = $result->fetchRow()) {
+ return $row['path'];
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * get the storage id of the storage for a file and the internal path of the file
+ *
+ * @param int $id
* @return array, first element holding the storage id, second the path
*/
static public function getById($id) {