Skip to content

Commit

Permalink
Ability to return new query of anynomous alias function in from() method
Browse files Browse the repository at this point in the history
  • Loading branch information
tuananhnghiem committed Apr 28, 2022
1 parent d23940b commit ef36df0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## Version

1. Added: Ability to return new query of anynomous alias function in from() method

## Version 3.2.0

1. Added: Ability to query from table alias
Expand Down
6 changes: 5 additions & 1 deletion Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ public function from()
}
} elseif (is_callable($value)) {
$query = new Query;
$value($query);
//To accept the return of new query object from return of anynomous function
$result = $value($query);
if($result!==null) {
$query = $result;
}
array_push($this->tables, array($query, $key));
}
}
Expand Down

0 comments on commit ef36df0

Please sign in to comment.