@@ -461,12 +461,12 @@ private function isInheritanceRelationship(ForeignKeyConstraint $fk)
461
461
*
462
462
* @param string $tableName
463
463
*
464
- * @return string |null
464
+ * @return ForeignKeyConstraint |null
465
465
*/
466
- public function getParentTable ($ tableName )
466
+ public function getParentRelationship ($ tableName )
467
467
{
468
468
return $ this ->fromCache ($ this ->cachePrefix .'_parent_ ' .$ tableName , function () use ($ tableName ) {
469
- return $ this ->getParentTableWithoutCache ($ tableName );
469
+ return $ this ->getParentRelationshipWithoutCache ($ tableName );
470
470
});
471
471
}
472
472
@@ -477,18 +477,18 @@ public function getParentTable($tableName)
477
477
*
478
478
* @param string $tableName
479
479
*
480
- * @return string |null
480
+ * @return ForeignKeyConstraint |null
481
481
*/
482
- private function getParentTableWithoutCache ($ tableName )
482
+ private function getParentRelationshipWithoutCache ($ tableName )
483
483
{
484
484
$ table = $ this ->getSchema ()->getTable ($ tableName );
485
485
foreach ($ table ->getForeignKeys () as $ fk ) {
486
486
if ($ this ->isInheritanceRelationship ($ fk )) {
487
- return $ fk-> getForeignTableName () ;
487
+ return $ fk ;
488
488
}
489
489
}
490
490
491
- return ;
491
+ return null ;
492
492
}
493
493
494
494
/**
@@ -498,12 +498,12 @@ private function getParentTableWithoutCache($tableName)
498
498
*
499
499
* @param string $tableName
500
500
*
501
- * @return string []
501
+ * @return ForeignKeyConstraint []
502
502
*/
503
- public function getChildrenTables ($ tableName )
503
+ public function getChildrenRelationships ($ tableName )
504
504
{
505
505
return $ this ->fromCache ($ this ->cachePrefix .'_children_ ' .$ tableName , function () use ($ tableName ) {
506
- return $ this ->getChildrenTablesWithoutCache ($ tableName );
506
+ return $ this ->getChildrenRelationshipsWithoutCache ($ tableName );
507
507
});
508
508
}
509
509
@@ -514,9 +514,9 @@ public function getChildrenTables($tableName)
514
514
*
515
515
* @param string $tableName
516
516
*
517
- * @return string []
517
+ * @return ForeignKeyConstraint []
518
518
*/
519
- private function getChildrenTablesWithoutCache ($ tableName )
519
+ private function getChildrenRelationshipsWithoutCache ($ tableName )
520
520
{
521
521
$ schema = $ this ->getSchema ();
522
522
$ children = [];
@@ -526,7 +526,7 @@ private function getChildrenTablesWithoutCache($tableName)
526
526
}
527
527
foreach ($ table ->getForeignKeys () as $ fk ) {
528
528
if ($ fk ->getForeignTableName () === $ tableName && $ this ->isInheritanceRelationship ($ fk )) {
529
- $ children [] = $ fk-> getLocalTableName () ;
529
+ $ children [] = $ fk ;
530
530
}
531
531
}
532
532
}
0 commit comments