Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2893168
DifferentialRevisionClosedStatusDatasource.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
DifferentialRevisionClosedStatusDatasource.php
View Options
<?php
final
class
DifferentialRevisionClosedStatusDatasource
extends
PhabricatorTypeaheadDatasource
{
const
FUNCTION_TOKEN
=
'closed()'
;
public
function
getBrowseTitle
(
)
{
return
pht
(
'Browse Any Closed Status'
)
;
}
public
function
getPlaceholderText
(
)
{
return
pht
(
'Type closed()...'
)
;
}
public
function
getDatasourceApplicationClass
(
)
{
return
PhabricatorDifferentialApplication
::
class
;
}
public
function
getDatasourceFunctions
(
)
{
return
array
(
'closed'
=>
array
(
'name'
=>
pht
(
'Any Closed Status'
)
,
'summary'
=>
pht
(
'Find results with any closed status.'
)
,
'description'
=>
pht
(
'This function includes results which have any closed status.'
)
,
)
,
)
;
}
public
function
loadResults
(
)
{
$results
=
array
(
$this
->
buildClosedResult
(
)
,
)
;
return
$this
->
filterResultsAgainstTokens
(
$results
)
;
}
protected
function
evaluateFunction
(
$function
,
array
$argv_list
)
{
$results
=
array
(
)
;
$map
=
DifferentialRevisionStatus
::
getAll
(
)
;
foreach
(
$argv_list
as
$argv
)
{
foreach
(
$map
as
$status
)
{
if
(
$status
->
isClosedStatus
(
)
)
{
$results
[
]
=
$status
->
getKey
(
)
;
}
}
}
return
$results
;
}
public
function
renderFunctionTokens
(
$function
,
array
$argv_list
)
{
$results
=
array
(
)
;
foreach
(
$argv_list
as
$argv
)
{
$results
[
]
=
PhabricatorTypeaheadTokenView
::
newFromTypeaheadResult
(
$this
->
buildClosedResult
(
)
)
;
}
return
$results
;
}
private
function
buildClosedResult
(
)
{
$name
=
pht
(
'Any Closed Status'
)
;
return
$this
->
newFunctionResult
(
)
->
setName
(
$name
.
' closed'
)
->
setDisplayName
(
$name
)
->
setPHID
(
self
::
FUNCTION_TOKEN
)
->
setUnique
(
true
)
->
addAttribute
(
pht
(
'Select any closed status.'
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 17:59 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1127202
Default Alt Text
DifferentialRevisionClosedStatusDatasource.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment