|
|
@ -1266,6 +1266,8 @@ class ActiveRecord extends Model |
|
|
|
$relation = $this->$getter(); |
|
|
|
$relation = $this->$getter(); |
|
|
|
if ($relation instanceof ActiveRelation) { |
|
|
|
if ($relation instanceof ActiveRelation) { |
|
|
|
return $relation; |
|
|
|
return $relation; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (UnknownMethodException $e) { |
|
|
|
} catch (UnknownMethodException $e) { |
|
|
|
throw new InvalidParamException(get_class($this) . ' has no relation named "' . $name . '".', 0, $e); |
|
|
|
throw new InvalidParamException(get_class($this) . ' has no relation named "' . $name . '".', 0, $e); |
|
|
|