/home/techb158/immovalet.com/platform/core/base/src/Supports
NameSizeModeActions
Action.php9550644editdlrm
ActionHookEvent.php21360644editdlrm
Assets.php23640644editdlrm
Avatar.php88450644editdlrm
BaseSeeder.php14380644editdlrm
BreadcrumbsGenerator.php17290644editdlrm
BreadcrumbsManager.php49300644editdlrm
Core.php73240644editdlrm
CustomResourceRegistrar.php31050644editdlrm
DashboardMenu.php60210644editdlrm
Editor.php13410644editdlrm
EmailAbstract.php18170644editdlrm
EmailHandler.php115100644editdlrm
Enum.php55020644editdlrm
Filter.php13240644editdlrm
Gravatar.php5320644editdlrm
Helper.php71290644editdlrm
Language.php176930644editdlrm
MacroableModels.php37510644editdlrm
MembershipAuthorization.php27020644editdlrm
MetaBox.php87200644editdlrm
MountManager.php39940644editdlrm
PageTitle.php6680644editdlrm
PclZip.php2144990644editdlrm
RepositoryHelper.php8190644editdlrm
SortItemsWithChildrenHelper.php22810644editdlrm
SystemManagement.php41620644editdlrm
Edit: /home/techb158/immovalet.com/platform/core/base/src/Supports/SortItemsWithChildrenHelper.php (2281B)
items = collect($items); return $this; } elseif ($items instanceof Collection) { $this->items = $items; return $this; } throw new Exception('Items must be array or collection'); } /** * @param string $string * @return $this */ public function setParentField(string $string): self { $this->parentField = $string; return $this; } /** * @param string $key * @return $this */ public function setCompareKey(string $key): self { $this->compareKey = $key; return $this; } /** * @param string $string * @return $this */ public function setChildrenProperty(string $string): self { $this->childrenProperty = $string; return $this; } /** * @return array */ public function sort(): array { return $this->processSort(); } /** * @param int $parentId * @return array */ protected function processSort(int $parentId = 0): array { $result = []; $filtered = $this->items->where($this->parentField, $parentId); foreach ($filtered as $item) { if (is_object($item)) { $item->{$this->childrenProperty} = $this->processSort($item->{$this->compareKey}); } else { $item[$this->childrenProperty] = $this->processSort(Arr::get($item, $this->compareKey)); } $result[] = $item; } return $result; } }