Commit 2a1efb59 authored by Guillaume Heurtier's avatar Guillaume Heurtier

FIX #11641 TIME 0:10 fix syntax on FolderController

parent 520fa854
...@@ -74,7 +74,6 @@ class FolderController ...@@ -74,7 +74,6 @@ class FolderController
'countResources' => $count 'countResources' => $count
]; ];
if ($folder['level'] == 0) { if ($folder['level'] == 0) {
// $tree[] = $insert;
array_splice($tree, 0, 0, [$insert]); array_splice($tree, 0, 0, [$insert]);
} else { } else {
$found = false; $found = false;
...@@ -215,7 +214,7 @@ class FolderController ...@@ -215,7 +214,7 @@ class FolderController
$level = $folderParent[0]['level'] + 1; $level = $folderParent[0]['level'] + 1;
} }
$this->updateChildren($aArgs['id'], $level); FolderController::updateChildren($aArgs['id'], $level);
FolderModel::update([ FolderModel::update([
'set' => [ 'set' => [
...@@ -670,7 +669,7 @@ class FolderController ...@@ -670,7 +669,7 @@ class FolderController
return false; return false;
} }
private function updateChildren($parentId, $levelParent) private static function updateChildren($parentId, $levelParent)
{ {
$folderChild = FolderModel::getChild(['id' => $parentId]); $folderChild = FolderModel::getChild(['id' => $parentId]);
if (!empty($folderChild)) { if (!empty($folderChild)) {
...@@ -678,7 +677,7 @@ class FolderController ...@@ -678,7 +677,7 @@ class FolderController
$level = -1; $level = -1;
foreach ($folderChild as $child) { foreach ($folderChild as $child) {
$level = $levelParent + 1; $level = $levelParent + 1;
$this->updateChildren($child['id'], $level); FolderController::updateChildren($child['id'], $level);
} }
$idsChildren = array_column($folderChild, 'id'); $idsChildren = array_column($folderChild, 'id');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment