Skip to content
Snippets Groups Projects
Commit cd2421c7 authored by Thomas Müller's avatar Thomas Müller
Browse files

adding PHPDoc comments to getBackend

ensure getChildren() is called on an instance of Share_Backend_Collection
parent 6aeb0a99
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -745,8 +745,8 @@ class Share {
/**
* @brief Get the backend class for the specified item type
* @param string Item type
* @return Sharing backend object
* @param string $itemType
* @return Share_Backend
*/
public static function getBackend($itemType) {
if (isset(self::$backends[$itemType])) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment