3 final class PhabricatorCustomFieldApplicationSearchNoneFunctionDatasource
4 extends PhabricatorTypeaheadDatasource
{
6 public function getBrowseTitle() {
7 return pht('Browse No Value');
10 public function getPlaceholderText() {
11 return pht('Type "none()"...');
14 public function getDatasourceApplicationClass() {
18 public function getDatasourceFunctions() {
21 'name' => pht('No Value'),
22 'summary' => pht('Find results with no value.'),
24 "This function includes results which have no value. Use a query ".
25 "like this to find results with no value:\n\n%s\n\n".
26 'If you combine this function with other constraints, results '.
27 'which have no value or the specified values will be returned.',
33 public function loadResults() {
35 $this->newNoneFunction(),
37 return $this->filterResultsAgainstTokens($results);
40 protected function evaluateFunction($function, array $argv_list) {
43 foreach ($argv_list as $argv) {
44 $results[] = new PhabricatorQueryConstraint(
45 PhabricatorQueryConstraint
::OPERATOR_NULL
,
52 public function renderFunctionTokens($function, array $argv_list) {
54 foreach ($argv_list as $argv) {
55 $results[] = PhabricatorTypeaheadTokenView
::newFromTypeaheadResult(
56 $this->newNoneFunction());
61 private function newNoneFunction() {
62 $name = pht('No Value');
63 return $this->newFunctionResult()
64 ->setName($name.' none')
65 ->setDisplayName($name)
69 ->addAttribute(pht('Select results with no value.'));