diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-24 10:37:58 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-24 10:37:58 +0200 |
commit | cd2421c7ee04e6d46481a1d0ae36387757b204fe (patch) | |
tree | 1279058d58924d077e138f9e90508e0699f6460f /apps/files_sharing/lib | |
parent | 6aeb0a99daf28ecb68b010d96369636a99ad77be (diff) | |
download | nextcloud-server-cd2421c7ee04e6d46481a1d0ae36387757b204fe.tar.gz nextcloud-server-cd2421c7ee04e6d46481a1d0ae36387757b204fe.zip |
adding PHPDoc comments to getBackend
ensure getChildren() is called on an instance of Share_Backend_Collection
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/cache.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index 51e8713b97a..123268e240a 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -20,6 +20,7 @@ */ namespace OC\Files\Cache; +use OCP\Share_Backend_Collection; /** * Metadata cache for shared files @@ -320,13 +321,17 @@ class Shared_Cache extends Cache { public function getAll() { $ids = \OCP\Share::getItemsSharedWith('file', \OC_Share_Backend_File::FORMAT_GET_ALL); $folderBackend = \OCP\Share::getBackend('folder'); - foreach ($ids as $file) { - $children = $folderBackend->getChildren($file); - foreach ($children as $child) { - $ids[] = (int)$child['source']; + if ($folderBackend instanceof Share_Backend_Collection) { + foreach ($ids as $file) { + /** @var $folderBackend Share_Backend_Collection */ + $children = $folderBackend->getChildren($file); + foreach ($children as $child) { + $ids[] = (int)$child['source']; + } + } - } + return $ids; } |