Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tables
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
grifart libs
tables
Merge requests
!51
implement ordering by specific values
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
implement ordering by specific values
order-by-values
into
master
Overview
0
Commits
1
Pipelines
1
Changes
6
Merged
Jiří Pudil
requested to merge
order-by-values
into
master
1 year ago
Overview
0
Commits
1
Pipelines
1
Changes
6
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
f1ee5cc3
1 commit,
1 year ago
6 files
+
95
−
26
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
src/OrderBy/OrderBy.php
+
3
−
23
Options
@@ -5,31 +5,11 @@ declare(strict_types=1);
namespace
Grifart\Tables\OrderBy
;
use
Dibi\Expression
as
DibiExpression
;
use
Grifart\Tables\Expression
;
f
in
al
class
OrderBy
in
terface
OrderBy
{
private
readonly
Nulls
$nulls
;
/**
* @
param Expression<mixed> $expression
* @
return DibiExpression the ORDER BY part of a Dibi query
*/
public
function
__construct
(
private
readonly
Expression
$expression
,
private
readonly
Direction
$direction
=
Direction
::
Ascending
,
Nulls
|
null
$nulls
=
null
,
)
{
$this
->
nulls
=
$nulls
??
Nulls
::
default
(
$this
->
direction
);
}
public
function
toSql
():
DibiExpression
{
return
new
DibiExpression
(
'? %ex %ex'
,
$this
->
expression
->
toSql
(),
$this
->
direction
->
toSql
(),
$this
->
nulls
->
toSql
(),
);
}
public
function
toSql
():
DibiExpression
;
}
Loading