FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
database/Expression/WindowInterface.php at 5.x · cakephp/database · GitHub
cakephp
/
database
Public
Notifications
You must be signed in to change notification settings
Fork
13
Star
98
Code
Actions
Security and quality
0
Insights
Additional navigation options
Code
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
database
/
Expression
/
WindowInterface.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
172 lines (155 loc) · 5.08 KB
Breadcrumbs
database
/
Expression
/
WindowInterface.php
Copy path
File metadata and controls
172 lines (155 loc) · 5.08 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?php
declare
(strict_types=
1
);
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 4.1.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace
Cake
\
Database
\
Expression
;
use
Cake
\
Database
\
ExpressionInterface
;
use
Closure
;
/**
* This defines the functions used for building window expressions.
*/
interface
WindowInterface
{
/**
* @var string
*/
public
const
PRECEDING
=
'
PRECEDING
'
;
/**
* @var string
*/
public
const
FOLLOWING
=
'
FOLLOWING
'
;
/**
* @var string
*/
public
const
RANGE
=
'
RANGE
'
;
/**
* @var string
*/
public
const
ROWS
=
'
ROWS
'
;
/**
* @var string
*/
public
const
GROUPS
=
'
GROUPS
'
;
/**
* Adds one or more partition expressions to the window.
*
* @param \Cake\Database\ExpressionInterface|\Closure|array<\Cake\Database\ExpressionInterface|string>|string $partitions Partition expressions
* @return $this
*/
public
function
partition
(
ExpressionInterface
|
Closure
|
array
|
string
$
partitions
);
/**
* Adds one or more order by clauses to the window.
*
* @param \Cake\Database\ExpressionInterface|\Closure|array<\Cake\Database\ExpressionInterface|string>|string $fields Order expressions
* @return $this
* @deprecated 5.0.0 Use orderBy() instead.
*/
public
function
order
(
ExpressionInterface
|
Closure
|
array
|
string
$
fields
);
/**
* Adds one or more order by clauses to the window.
*
* @param \Cake\Database\ExpressionInterface|\Closure|array<\Cake\Database\ExpressionInterface|string>|string $fields Order expressions
* @return $this
*/
public
function
orderBy
(
ExpressionInterface
|
Closure
|
array
|
string
$
fields
);
/**
* Adds a simple range frame to the window.
*
* `$start`:
* - `0` - 'CURRENT ROW'
* - `null` - 'UNBOUNDED PRECEDING'
* - offset - 'offset PRECEDING'
*
* `$end`:
* - `0` - 'CURRENT ROW'
* - `null` - 'UNBOUNDED FOLLOWING'
* - offset - 'offset FOLLOWING'
*
* If you need to use 'FOLLOWING' with frame start or
* 'PRECEDING' with frame end, use `frame()` instead.
*
* @param \Cake\Database\ExpressionInterface|string|int|null $start Frame start
* @param \Cake\Database\ExpressionInterface|string|int|null $end Frame end
* If not passed in, only frame start SQL will be generated.
* @return $this
*/
public
function
range
(
ExpressionInterface
|
string
|
int
|
null
$
start
,
ExpressionInterface
|
string
|
int
|
null
$
end
=
0
);
/**
* Adds a simple rows frame to the window.
*
* See `range()` for details.
*
* @param int|null $start Frame start
* @param int|null $end Frame end
* If not passed in, only frame start SQL will be generated.
* @return $this
*/
public
function
rows
(?
int
$
start
, ?
int
$
end
=
0
);
/**
* Adds a simple groups frame to the window.
*
* See `range()` for details.
*
* @param int|null $start Frame start
* @param int|null $end Frame end
* If not passed in, only frame start SQL will be generated.
* @return $this
*/
public
function
groups
(?
int
$
start
, ?
int
$
end
=
0
);
/**
* Adds a frame to the window.
*
* Use the `range()`, `rows()` or `groups()` helpers if you need simple
* 'BETWEEN offset PRECEDING and offset FOLLOWING' frames.
*
* You can specify any direction for both frame start and frame end.
*
* With both `$startOffset` and `$endOffset`:
* - `0` - 'CURRENT ROW'
* - `null` - 'UNBOUNDED'
*
* @param self::RANGE|self::ROWS|self::GROUPS $type Frame type
* @param \Cake\Database\ExpressionInterface|string|int|null $startOffset Frame start offset
* @param self::PRECEDING|self::FOLLOWING $startDirection Frame start direction
* @param \Cake\Database\ExpressionInterface|string|int|null $endOffset Frame end offset
* @param self::PRECEDING|self::FOLLOWING $endDirection Frame end direction
* @return $this
* @throws \InvalidArgumentException WHen offsets are negative.
*/
public
function
frame
(
string
$
type
,
ExpressionInterface
|
string
|
int
|
null
$
startOffset
,
string
$
startDirection
,
ExpressionInterface
|
string
|
int
|
null
$
endOffset
,
string
$
endDirection
,
);
/**
* Adds current row frame exclusion.
*
* @return $this
*/
public
function
excludeCurrent
();
/**
* Adds group frame exclusion.
*
* @return $this
*/
public
function
excludeGroup
();
/**
* Adds ties frame exclusion.
*
* @return $this
*/
public
function
excludeTies
();
}
Back
|
FazBrowse Home
|
New Git URL