Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed
<?phpuse App\Models\Directory;use Illuminate\Support\Collection;function getPath( $root, $return_locked_folders = false ): Collection{$ini = $GLOBALS["INI"];$treeRoot = -1;if ( $ini["treeRoot"] ){$treeRoot = $ini["treeRoot"];}$path = collect();$father = $root;while ( $father != $treeRoot && !is_null( $father ) ){$row = Directory::where( "id", $father )->whereIn( "status", [ 0, 2 ] )->firstOrFail();$father = $row->directory_id;$path[] = $row;}return $path->reverse();}