staudenmeir /
eloquent-eager-limit-x-laravel-cte
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Staudenmeir\EloquentEagerLimitXLaravelCte\Query\Grammars; |
||
| 4 | |||
| 5 | use Illuminate\Database\Query\Builder; |
||
| 6 | use Illuminate\Database\Query\Grammars\PostgresGrammar as Base; |
||
| 7 | use Staudenmeir\EloquentEagerLimit\Grammars\Traits\CompilesPostgresGroupLimit; |
||
| 8 | use Staudenmeir\LaravelCte\Query\Grammars\Traits\CompilesPostgresExpressions; |
||
| 9 | |||
| 10 | class PostgresGrammar extends Base |
||
| 11 | { |
||
| 12 | use CompilesPostgresGroupLimit, CompilesPostgresExpressions { |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 13 | CompilesPostgresGroupLimit::compileSelect as compileSelect1; |
||
| 14 | CompilesPostgresExpressions::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 | 43 | public function compileSelect(Builder $query) |
|
| 24 | { |
||
| 25 | 43 | if (isset($query->groupLimit)) { |
|
| 26 | 24 | return $this->compileSelect1($query); |
|
| 27 | } |
||
| 28 | |||
| 29 | 43 | return $this->compileSelect2($query); |
|
| 30 | } |
||
| 31 | } |
||
| 32 |