Differential D12458 Diff 29954 src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | public function getBrowseURI() { | ||||
$uri->setQueryParams($this->parameters); | $uri->setQueryParams($this->parameters); | ||||
return (string)$uri; | return (string)$uri; | ||||
} | } | ||||
abstract public function getPlaceholderText(); | abstract public function getPlaceholderText(); | ||||
abstract public function getDatasourceApplicationClass(); | abstract public function getDatasourceApplicationClass(); | ||||
abstract public function loadResults(); | abstract public function loadResults(); | ||||
protected function didLoadResults(array $results) { | |||||
return $results; | |||||
} | |||||
public static function tokenizeString($string) { | public static function tokenizeString($string) { | ||||
$string = phutil_utf8_strtolower($string); | $string = phutil_utf8_strtolower($string); | ||||
$string = trim($string); | $string = trim($string); | ||||
if (!strlen($string)) { | if (!strlen($string)) { | ||||
return array(); | return array(); | ||||
} | } | ||||
$tokens = preg_split('/\s+|[-\[\]]/', $string); | $tokens = preg_split('/\s+|[-\[\]]/', $string); | ||||
▲ Show 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | abstract class PhabricatorTypeaheadDatasource extends Phobject { | ||||
} | } | ||||
/* -( Token Functions )---------------------------------------------------- */ | /* -( Token Functions )---------------------------------------------------- */ | ||||
/** | /** | ||||
* @task functions | * @task functions | ||||
*/ | */ | ||||
public function getDatasourceFunctions() { | |||||
return array(); | |||||
} | |||||
/** | |||||
* @task functions | |||||
*/ | |||||
protected function canEvaluateFunction($function) { | protected function canEvaluateFunction($function) { | ||||
return false; | $functions = $this->getDatasourceFunctions(); | ||||
return isset($functions[$function]); | |||||
} | } | ||||
/** | /** | ||||
* @task functions | * @task functions | ||||
*/ | */ | ||||
protected function evaluateFunction($function, array $argv_list) { | protected function evaluateFunction($function, array $argv_list) { | ||||
throw new PhutilMethodNotImplementedException(); | throw new PhutilMethodNotImplementedException(); | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |