Skip to content

Commit

Permalink
Allow Macro calls on JoinClause (#112)
Browse files Browse the repository at this point in the history
* Allow macros calls on JoinClause

* Fix variable name for macro

* Fixing the formatting

Co-authored-by: Luís Dalmolin <[email protected]>

Co-authored-by: Luís Dalmolin <[email protected]>
  • Loading branch information
glamax13 and luisdalmolin authored Dec 9, 2022
1 parent ad4ce61 commit e69c883
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/PowerJoinClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ public function __call($name, $arguments)
if (method_exists($this->getModel(), $scope)) {
return $this->getModel()->{$scope}($this, ...$arguments);
} else {
throw new InvalidArgumentException(sprintf('Method %s does not exist in PowerJoinClause class', $name));
if (static::hasMacro($name)) {
return $this->macroCall($name, $arguments);
} else {
throw new InvalidArgumentException(sprintf('Method %s does not exist in PowerJoinClause class', $name));
}
}
}
}

0 comments on commit e69c883

Please sign in to comment.