2323use PhpMyAdmin \Navigation \Nodes \NodeColumnContainer ;
2424use PhpMyAdmin \Navigation \Nodes \NodeDatabase ;
2525use PhpMyAdmin \Navigation \Nodes \NodeDatabaseContainer ;
26- use PhpMyAdmin \Navigation \Nodes \NodeEvent ;
2726use PhpMyAdmin \Navigation \Nodes \NodeEventContainer ;
28- use PhpMyAdmin \Navigation \Nodes \NodeFunction ;
2927use PhpMyAdmin \Navigation \Nodes \NodeFunctionContainer ;
30- use PhpMyAdmin \Navigation \Nodes \NodeIndex ;
3128use PhpMyAdmin \Navigation \Nodes \NodeIndexContainer ;
32- use PhpMyAdmin \Navigation \Nodes \NodeProcedure ;
3329use PhpMyAdmin \Navigation \Nodes \NodeProcedureContainer ;
3430use PhpMyAdmin \Navigation \Nodes \NodeTable ;
3531use PhpMyAdmin \Navigation \Nodes \NodeTableContainer ;
36- use PhpMyAdmin \Navigation \Nodes \NodeTrigger ;
3732use PhpMyAdmin \Navigation \Nodes \NodeTriggerContainer ;
38- use PhpMyAdmin \Navigation \Nodes \NodeView ;
3933use PhpMyAdmin \Navigation \Nodes \NodeViewContainer ;
4034use PhpMyAdmin \ResponseRenderer ;
4135use PhpMyAdmin \Template ;
@@ -310,13 +304,7 @@ private function buildPath(UserPrivileges $userPrivileges): Node|bool
310304 $ retval = $ this ->tree ;
311305
312306 // Add all databases unconditionally
313- $ data = $ this ->tree ->getData (
314- $ userPrivileges ,
315- $ this ->relationParameters ,
316- 'databases ' ,
317- $ this ->pos ,
318- $ this ->searchClause ,
319- );
307+ $ data = $ this ->tree ->getData ($ userPrivileges , $ this ->pos , $ this ->searchClause );
320308 $ hiddenCounts = $ this ->tree ->getNavigationHidingData ($ this ->relationParameters ->navigationItemsHidingFeature );
321309 foreach ($ data as $ db ) {
322310 $ node = new NodeDatabase ($ this ->config , $ db );
@@ -397,27 +385,13 @@ private function buildPathPart(
397385 }
398386
399387 if (count ($ container ->children ) <= 1 ) {
400- $ dbData = $ db ->getData (
401- $ userPrivileges ,
388+ $ dbData = $ db ->getDatabaseObjects (
402389 $ this ->relationParameters ,
403390 $ container ->realName ,
404391 $ pos2 ,
405392 $ this ->searchClause2 ,
406393 );
407- foreach ($ dbData as $ item ) {
408- $ node = match ($ container ->realName ) {
409- 'events ' => new NodeEvent ($ this ->config , $ item ),
410- 'functions ' => new NodeFunction ($ this ->config , $ item ),
411- 'procedures ' => new NodeProcedure ($ this ->config , $ item ),
412- 'tables ' => new NodeTable ($ this ->config , $ item ),
413- 'views ' => new NodeView ($ this ->config , $ item ),
414- default => null ,
415- };
416-
417- if ($ node === null ) {
418- continue ;
419- }
420-
394+ foreach ($ dbData as $ node ) {
421395 if ($ type2 === $ container ->realName ) {
422396 $ node ->pos2 = $ pos2 ;
423397 }
@@ -448,6 +422,7 @@ private function buildPathPart(
448422 }
449423
450424 $ container ->addChild ($ node );
425+ /** @var NodeTable|null $table */
451426 $ table = $ container ->getChild ($ path [0 ], true );
452427 if ($ table === null ) {
453428 return false ;
@@ -465,19 +440,13 @@ private function buildPathPart(
465440 return false ;
466441 }
467442
468- $ tableData = $ table ->getData ($ userPrivileges , $ this ->relationParameters , $ container ->realName , $ pos3 );
469- foreach ($ tableData as $ item ) {
470- $ node = match ($ container ->realName ) {
471- 'indexes ' => new NodeIndex ($ this ->config , $ item ),
472- 'columns ' => new NodeColumn ($ this ->config , $ item ),
473- 'triggers ' => new NodeTrigger ($ this ->config , $ item ),
474- default => null ,
475- };
476-
477- if ($ node === null ) {
478- continue ;
479- }
480-
443+ $ tableData = match ($ container ->realName ) {
444+ 'indexes ' => $ table ->getIndexes ($ this ->dbi , $ pos3 ),
445+ 'columns ' => $ table ->getColumns ($ this ->dbi , $ pos3 ),
446+ 'triggers ' => $ table ->getTriggers ($ this ->dbi , $ pos3 ),
447+ default => [],
448+ };
449+ foreach ($ tableData as $ node ) {
481450 $ node ->pos2 = $ container ->parent ->pos2 ;
482451 if ($ type3 === $ container ->realName ) {
483452 $ node ->pos3 = $ pos3 ;
0 commit comments