Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F455213
PhabricatorCustomFieldApplicationSearchAnyFunctionDatasource.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
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.'
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 6:40 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
69877
Default Alt Text
PhabricatorCustomFieldApplicationSearchAnyFunctionDatasource.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment