Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2895881
DifferentialRevisionOpenStatusDatasource.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
DifferentialRevisionOpenStatusDatasource.php
View Options
<?php
final
class
DifferentialRevisionOpenStatusDatasource
extends
PhabricatorTypeaheadDatasource
{
const
FUNCTION_TOKEN
=
'open()'
;
public
function
getBrowseTitle
(
)
{
return
pht
(
'Browse Any Open Status'
)
;
}
public
function
getPlaceholderText
(
)
{
return
pht
(
'Type open()...'
)
;
}
public
function
getDatasourceApplicationClass
(
)
{
return
PhabricatorDifferentialApplication
::
class
;
}
public
function
getDatasourceFunctions
(
)
{
return
array
(
'open'
=>
array
(
'name'
=>
pht
(
'Any Open Status'
)
,
'summary'
=>
pht
(
'Find results with any open status.'
)
,
'description'
=>
pht
(
'This function includes results which have any open status.'
)
,
)
,
)
;
}
public
function
loadResults
(
)
{
$results
=
array
(
$this
->
buildOpenResult
(
)
,
)
;
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
->
buildOpenResult
(
)
)
;
}
return
$results
;
}
private
function
buildOpenResult
(
)
{
$name
=
pht
(
'Any Open Status'
)
;
return
$this
->
newFunctionResult
(
)
->
setName
(
$name
.
' open'
)
->
setDisplayName
(
$name
)
->
setPHID
(
self
::
FUNCTION_TOKEN
)
->
setUnique
(
true
)
->
addAttribute
(
pht
(
'Select any open status.'
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 22:12 (6 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1129278
Default Alt Text
DifferentialRevisionOpenStatusDatasource.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment