Skip to content

Commit aa8ff00

Browse files
committed
Add guard to run only when it returns ActiveQueryInterface
close #67
1 parent 9c172bb commit aa8ff00

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

RelationTrait.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,9 @@ public function getRelationData()
482482
if($method->getNumberOfParameters() > 0) {
483483
continue;
484484
}
485+
if((string)$method->getReturnType() !== ActiveQueryInterface::class){
486+
continue;
487+
}
485488
try {
486489
$rel = call_user_func(array($this, $method->name));
487490
if ($rel instanceof ActiveQuery) {

0 commit comments

Comments
 (0)