@@ -461,12 +461,12 @@ private function isInheritanceRelationship(ForeignKeyConstraint $fk)
461461 *
462462 * @param string $tableName
463463 *
464- * @return string |null
464+ * @return ForeignKeyConstraint |null
465465 */
466- public function getParentTable ($ tableName )
466+ public function getParentRelationship ($ tableName )
467467 {
468468 return $ this ->fromCache ($ this ->cachePrefix .'_parent_ ' .$ tableName , function () use ($ tableName ) {
469- return $ this ->getParentTableWithoutCache ($ tableName );
469+ return $ this ->getParentRelationshipWithoutCache ($ tableName );
470470 });
471471 }
472472
@@ -477,18 +477,18 @@ public function getParentTable($tableName)
477477 *
478478 * @param string $tableName
479479 *
480- * @return string |null
480+ * @return ForeignKeyConstraint |null
481481 */
482- private function getParentTableWithoutCache ($ tableName )
482+ private function getParentRelationshipWithoutCache ($ tableName )
483483 {
484484 $ table = $ this ->getSchema ()->getTable ($ tableName );
485485 foreach ($ table ->getForeignKeys () as $ fk ) {
486486 if ($ this ->isInheritanceRelationship ($ fk )) {
487- return $ fk-> getForeignTableName () ;
487+ return $ fk ;
488488 }
489489 }
490490
491- return ;
491+ return null ;
492492 }
493493
494494 /**
@@ -498,12 +498,12 @@ private function getParentTableWithoutCache($tableName)
498498 *
499499 * @param string $tableName
500500 *
501- * @return string []
501+ * @return ForeignKeyConstraint []
502502 */
503- public function getChildrenTables ($ tableName )
503+ public function getChildrenRelationships ($ tableName )
504504 {
505505 return $ this ->fromCache ($ this ->cachePrefix .'_children_ ' .$ tableName , function () use ($ tableName ) {
506- return $ this ->getChildrenTablesWithoutCache ($ tableName );
506+ return $ this ->getChildrenRelationshipsWithoutCache ($ tableName );
507507 });
508508 }
509509
@@ -514,9 +514,9 @@ public function getChildrenTables($tableName)
514514 *
515515 * @param string $tableName
516516 *
517- * @return string []
517+ * @return ForeignKeyConstraint []
518518 */
519- private function getChildrenTablesWithoutCache ($ tableName )
519+ private function getChildrenRelationshipsWithoutCache ($ tableName )
520520 {
521521 $ schema = $ this ->getSchema ();
522522 $ children = [];
@@ -526,7 +526,7 @@ private function getChildrenTablesWithoutCache($tableName)
526526 }
527527 foreach ($ table ->getForeignKeys () as $ fk ) {
528528 if ($ fk ->getForeignTableName () === $ tableName && $ this ->isInheritanceRelationship ($ fk )) {
529- $ children [] = $ fk-> getLocalTableName () ;
529+ $ children [] = $ fk ;
530530 }
531531 }
532532 }
0 commit comments