Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99299222
PhabricatorCustomFieldApplicationSearchAnyFunctionDatasource.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
Thu, Jan 23, 05:43
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Jan 25, 05:43 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
23771224
Attached To
rPH Phabricator
PhabricatorCustomFieldApplicationSearchAnyFunctionDatasource.php
View Options
<?php
final
class
PhabricatorCustomFieldApplicationSearchAnyFunctionDatasource
extends
PhabricatorTypeaheadDatasource
{
public
function
getBrowseTitle
()
{
return
pht
(
'Browse Any'
);
}
public
function
getPlaceholderText
()
{
return
pht
(
'Type "any()"...'
);
}
public
function
getDatasourceApplicationClass
()
{
return
null
;
}
public
function
getDatasourceFunctions
()
{
return
array
(
'any'
=>
array
(
'name'
=>
pht
(
'Any Value'
),
'summary'
=>
pht
(
'Find results with any value.'
),
'description'
=>
pht
(
"This function includes results which have any value. Use a query "
.
"like this to find results with any value:
\n\n
%s"
,
'> any()'
),
),
);
}
public
function
loadResults
()
{
$results
=
array
(
$this
->
newAnyFunction
(),
);
return
$this
->
filterResultsAgainstTokens
(
$results
);
}
protected
function
evaluateFunction
(
$function
,
array
$argv_list
)
{
$results
=
array
();
foreach
(
$argv_list
as
$argv
)
{
$results
[]
=
new
PhabricatorQueryConstraint
(
PhabricatorQueryConstraint
::
OPERATOR_ANY
,
null
);
}
return
$results
;
}
public
function
renderFunctionTokens
(
$function
,
array
$argv_list
)
{
$results
=
array
();
foreach
(
$argv_list
as
$argv
)
{
$results
[]
=
PhabricatorTypeaheadTokenView
::
newFromTypeaheadResult
(
$this
->
newAnyFunction
());
}
return
$results
;
}
private
function
newAnyFunction
()
{
$name
=
pht
(
'Any Value'
);
return
$this
->
newFunctionResult
()
->
setName
(
$name
.
' any'
)
->
setDisplayName
(
$name
)
->
setIcon
(
'fa-circle-o'
)
->
setPHID
(
'any()'
)
->
setUnique
(
true
)
->
addAttribute
(
pht
(
'Select results with any value.'
));
}
}
Event Timeline
Log In to Comment