Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96578059
DifferentialLegacyQuery.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Dec 28, 10:50
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Dec 30, 10:50 (2 d)
Engine
blob
Format
Raw Data
Handle
23210344
Attached To
rPH Phabricator
DifferentialLegacyQuery.php
View Options
<?php
final
class
DifferentialLegacyQuery
extends
Phobject
{
const
STATUS_ANY
=
'status-any'
;
const
STATUS_OPEN
=
'status-open'
;
const
STATUS_ACCEPTED
=
'status-accepted'
;
const
STATUS_NEEDS_REVIEW
=
'status-needs-review'
;
const
STATUS_NEEDS_REVISION
=
'status-needs-revision'
;
const
STATUS_CLOSED
=
'status-closed'
;
const
STATUS_ABANDONED
=
'status-abandoned'
;
public
static
function
getAllConstants
()
{
return
array_keys
(
self
::
getMap
());
}
public
static
function
getModernValues
(
$status
)
{
if
(
$status
===
self
::
STATUS_ANY
)
{
return
null
;
}
$map
=
self
::
getMap
();
if
(!
isset
(
$map
[
$status
]))
{
throw
new
Exception
(
pht
(
'Unknown revision status filter constant "%s".'
,
$status
));
}
return
$map
[
$status
];
}
private
static
function
getMap
()
{
$all
=
array_keys
(
DifferentialRevisionStatus
::
getAll
());
$open
=
array
();
$closed
=
array
();
foreach
(
$all
as
$status
)
{
$status_object
=
DifferentialRevisionStatus
::
newForStatus
(
$status
);
if
(
$status_object
->
isClosedStatus
())
{
$closed
[]
=
$status_object
->
getKey
();
}
else
{
$open
[]
=
$status_object
->
getKey
();
}
}
return
array
(
self
::
STATUS_ANY
=>
$all
,
self
::
STATUS_OPEN
=>
$open
,
self
::
STATUS_ACCEPTED
=>
array
(
DifferentialRevisionStatus
::
ACCEPTED
,
),
self
::
STATUS_NEEDS_REVIEW
=>
array
(
DifferentialRevisionStatus
::
NEEDS_REVIEW
,
// For legacy callers, "Draft" is treated as "Needs Review".
DifferentialRevisionStatus
::
DRAFT
,
),
self
::
STATUS_NEEDS_REVISION
=>
array
(
DifferentialRevisionStatus
::
NEEDS_REVISION
,
),
self
::
STATUS_CLOSED
=>
$closed
,
self
::
STATUS_ABANDONED
=>
array
(
DifferentialRevisionStatus
::
ABANDONED
,
),
);
}
}
Event Timeline
Log In to Comment