1 | <?php |
||
2 | |||
3 | namespace Staudenmeir\EloquentEagerLimitXLaravelCte\Query\Grammars; |
||
4 | |||
5 | use Illuminate\Database\Query\Builder; |
||
6 | use Illuminate\Database\Query\Grammars\SQLiteGrammar as Base; |
||
7 | use Staudenmeir\EloquentEagerLimit\Grammars\Traits\CompilesSQLiteGroupLimit; |
||
8 | use Staudenmeir\LaravelCte\Query\Grammars\Traits\CompilesSQLiteExpressions; |
||
9 | |||
10 | class SQLiteGrammar extends Base |
||
11 | { |
||
12 | use CompilesSQLiteGroupLimit, CompilesSQLiteExpressions { |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
13 | CompilesSQLiteGroupLimit::compileSelect as compileSelect1; |
||
14 | CompilesSQLiteExpressions::compileSelect as compileSelect2; |
||
15 | } |
||
16 | |||
17 | /** |
||
18 | * Compile a select query into SQL. |
||
19 | * |
||
20 | * @param \Illuminate\Database\Query\Builder $query |
||
21 | * @return string |
||
22 | */ |
||
23 | 42 | public function compileSelect(Builder $query) |
|
24 | { |
||
25 | 42 | if (isset($query->groupLimit)) { |
|
26 | 24 | return $this->compileSelect1($query); |
|
27 | } |
||
28 | |||
29 | 42 | return $this->compileSelect2($query); |
|
30 | } |
||
31 | } |
||
32 |