Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/ferret/PhabricatorFerretEngine.php
Show All 28 Lines | final public function getFunctionForName($raw_name) { | ||||
if ($this->ferretFunctions === null) { | if ($this->ferretFunctions === null) { | ||||
$functions = FerretSearchFunction::newFerretSearchFunctions(); | $functions = FerretSearchFunction::newFerretSearchFunctions(); | ||||
$this->ferretFunctions = $functions; | $this->ferretFunctions = $functions; | ||||
} | } | ||||
if (!isset($this->ferretFunctions[$normalized_name])) { | if (!isset($this->ferretFunctions[$normalized_name])) { | ||||
throw new PhutilSearchQueryCompilerSyntaxException( | throw new PhutilSearchQueryCompilerSyntaxException( | ||||
pht( | pht( | ||||
'Unknown search function "%s". Supported functions are: %s.', | 'Unknown search function "%s". Supported functions are: %s. '. | ||||
'(To search for a term containing a colon, surround the term '. | |||||
'in double quotes.)', | |||||
$raw_name, | $raw_name, | ||||
implode(', ', array_keys($this->ferretFunctions)))); | implode(', ', array_keys($this->ferretFunctions)))); | ||||
} | } | ||||
$function = $this->ferretFunctions[$normalized_name]; | $function = $this->ferretFunctions[$normalized_name]; | ||||
$this->fieldMap[$raw_name] = $function; | $this->fieldMap[$raw_name] = $function; | ||||
return $this->fieldMap[$raw_name]; | return $this->fieldMap[$raw_name]; | ||||
▲ Show 20 Lines • Show All 200 Lines • Show Last 20 Lines |