Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3295234
PhabricatorPeopleAnyOwnerDatasource.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
PhabricatorPeopleAnyOwnerDatasource.php
View Options
<?php
final
class
PhabricatorPeopleAnyOwnerDatasource
extends
PhabricatorTypeaheadDatasource
{
const
FUNCTION_TOKEN
=
'anyone()'
;
public
function
getBrowseTitle
(
)
{
return
pht
(
'Browse Any Owner'
)
;
}
public
function
getPlaceholderText
(
)
{
return
pht
(
'Type "anyone()"...'
)
;
}
public
function
getDatasourceApplicationClass
(
)
{
return
PhabricatorPeopleApplication
::
class
;
}
public
function
getDatasourceFunctions
(
)
{
return
array
(
'anyone'
=>
array
(
'name'
=>
pht
(
'Anyone'
)
,
'summary'
=>
pht
(
'Find results which are assigned to anyone.'
)
,
'description'
=>
pht
(
'This function includes results which have any owner. It excludes '
.
'unassigned or unowned results.'
)
,
)
,
)
;
}
public
function
loadResults
(
)
{
$results
=
array
(
$this
->
buildAnyoneResult
(
)
,
)
;
return
$this
->
filterResultsAgainstTokens
(
$results
)
;
}
protected
function
evaluateFunction
(
$function
,
array
$argv_list
)
{
$results
=
array
(
)
;
foreach
(
$argv_list
as
$argv
)
{
$results
[
]
=
self
::
FUNCTION_TOKEN
;
}
return
$results
;
}
public
function
renderFunctionTokens
(
$function
,
array
$argv_list
)
{
$results
=
array
(
)
;
foreach
(
$argv_list
as
$argv
)
{
$results
[
]
=
PhabricatorTypeaheadTokenView
::
newFromTypeaheadResult
(
$this
->
buildAnyoneResult
(
)
)
;
}
return
$results
;
}
private
function
buildAnyoneResult
(
)
{
$name
=
pht
(
'Any Owner'
)
;
return
$this
->
newFunctionResult
(
)
->
setName
(
$name
.
' anyone'
)
->
setDisplayName
(
$name
)
->
setIcon
(
'fa-certificate'
)
->
setPHID
(
self
::
FUNCTION_TOKEN
)
->
setUnique
(
true
)
->
addAttribute
(
pht
(
'Select results with any owner.'
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Mar 27, 01:33 (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1186068
Default Alt Text
PhabricatorPeopleAnyOwnerDatasource.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment