3 final class PhabricatorCustomFieldApplicationSearchAnyFunctionDatasource
4 extends PhabricatorTypeaheadDatasource
{
6 public function getBrowseTitle() {
7 return pht('Browse Any');
10 public function getPlaceholderText() {
11 return pht('Type "any()"...');
14 public function getDatasourceApplicationClass() {
18 public function getDatasourceFunctions() {
21 'name' => pht('Any Value'),
22 'summary' => pht('Find results with any value.'),
24 "This function includes results which have any value. Use a query ".
25 "like this to find results with any value:\n\n%s",
31 public function loadResults() {
33 $this->newAnyFunction(),
35 return $this->filterResultsAgainstTokens($results);
38 protected function evaluateFunction($function, array $argv_list) {
41 foreach ($argv_list as $argv) {
42 $results[] = new PhabricatorQueryConstraint(
43 PhabricatorQueryConstraint
::OPERATOR_ANY
,
50 public function renderFunctionTokens($function, array $argv_list) {
52 foreach ($argv_list as $argv) {
53 $results[] = PhabricatorTypeaheadTokenView
::newFromTypeaheadResult(
54 $this->newAnyFunction());
59 private function newAnyFunction() {
60 $name = pht('Any Value');
61 return $this->newFunctionResult()
62 ->setName($name.' any')
63 ->setDisplayName($name)
64 ->setIcon('fa-circle-o')
67 ->addAttribute(pht('Select results with any value.'));