|
@@ 714-718 (lines=5) @@
|
| 711 |
|
// If no relation name was given, we will use this debug backtrace to extract |
| 712 |
|
// the calling method's name and use that as the relationship name as most |
| 713 |
|
// of the time this will be what we desire to use for the relationships. |
| 714 |
|
if (is_null($relation)) { |
| 715 |
|
list(, $caller) = debug_backtrace(false); |
| 716 |
|
|
| 717 |
|
$relation = $caller['function']; |
| 718 |
|
} |
| 719 |
|
|
| 720 |
|
// If no foreign key was supplied, we can use a backtrace to guess the proper |
| 721 |
|
// foreign key name by using the name of the relationship function, which |
|
@@ 749-753 (lines=5) @@
|
| 746 |
|
// If no name is provided, we will use the backtrace to get the function name |
| 747 |
|
// since that is most likely the name of the polymorphic interface. We can |
| 748 |
|
// use that to get both the class and foreign key that will be utilized. |
| 749 |
|
if (is_null($name)) { |
| 750 |
|
list(, $caller) = debug_backtrace(false); |
| 751 |
|
|
| 752 |
|
$name = snake_case($caller['function']); |
| 753 |
|
} |
| 754 |
|
|
| 755 |
|
list($type, $id) = $this->getMorphs($name, $type, $id); |
| 756 |
|
|