Skip to content

Commit ef36df0

Browse files
committed
Ability to return new query of anynomous alias function in from() method
1 parent d23940b commit ef36df0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## Version
4+
5+
1. Added: Ability to return new query of anynomous alias function in from() method
6+
37
## Version 3.2.0
48

59
1. Added: Ability to query from table alias

Query.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ public function from()
119119
}
120120
} elseif (is_callable($value)) {
121121
$query = new Query;
122-
$value($query);
122+
//To accept the return of new query object from return of anynomous function
123+
$result = $value($query);
124+
if($result!==null) {
125+
$query = $result;
126+
}
123127
array_push($this->tables, array($query, $key));
124128
}
125129
}

0 commit comments

Comments
 (0)