Page MenuHomeGitPull.it
Diviner Tech Docs PhabricatorTypeaheadDatasource

abstract class PhabricatorTypeaheadDatasource
Phorge Technical Documentation (Typeahead)

This class is not documented.

Tasks

Token Functions

  • public function getDatasourceFunctions() — Return available function tokens for this typeahead datasource, with each key being the function name (e.g. any, not, null, only) and each value being another array containing name, summary, description. See the "Function Quick Reference" in the Typeahead Function Help for details.
  • public function getAllDatasourceFunctions() — Return all function tokens for typeahead datasources, with each key being the function name (e.g. any, not, null, only) and each value being another array containing name, summary, description. See the "Function Quick Reference" in the Typeahead Function Help for details.
  • protected function isFunctionWithLoginRequired($function) — Check if this datasource requires a logged-in viewer.
  • protected function canEvaluateFunction($function)
  • protected function shouldStripFunction($function)
  • protected function evaluateFunction($function, $argv_list)
  • protected function evaluateValues($values)
  • public function evaluateTokens($tokens)
  • protected function didEvaluateTokens($results)
  • public static function isFunctionToken($token)
  • protected function parseFunction($token, $allow_partial)
  • public function renderFunctionTokens($function, $argv_list)
  • public function setFunctionStack($function_stack)
  • public function getFunctionStack() — Get the function tokens entered in the typeahead field, e.g. "not" or "any"
  • protected function getCurrentFunction()

Other Methods

Methods

public function setLimit($limit)

This method is not documented.
Parameters
$limit
Return
wild

public function getLimit()

This method is not documented.
Return
wild

public function setOffset($offset)

This method is not documented.
Parameters
$offset
Return
wild

public function getOffset()

This method is not documented.
Return
wild

public function getViewer()

This method is not documented.
Return
wild

public function setRawQuery($raw_query)

This method is not documented.
Parameters
$raw_query
Return
wild

public function getPrefixQuery()

This method is not documented.
Return
wild

public function getRawQuery()

This method is not documented.
Return
wild

public function setQuery($query)

This method is not documented.
Parameters
$query
Return
wild

public function getQuery()

This method is not documented.
Return
wild

public function setParameters($params)

This method is not documented.
Parameters
array$params
Return
wild

public function getParameters()

This method is not documented.
Return
wild

public function getParameter($name, $default)

This method is not documented.
Parameters
$name
$default
Return
wild

public function setIsBrowse($is_browse)

This method is not documented.
Parameters
$is_browse
Return
wild

public function getIsBrowse()

This method is not documented.
Return
wild

public function setPhase($phase)

This method is not documented.
Parameters
$phase
Return
wild

public function getPhase()

This method is not documented.
Return
wild

public function getDatasourceURI()

This method is not documented.
Return
stringA text URI consisting of '/typeahead/class/' followed by a datasource (e.g. 'PhabricatorProjectDatasource/') and optionally URI parameters (e.g. '?parameters=%7B%22autocomplete%22%3A1%7D')

public function getBrowseURI()

This method is not documented.
Return
string|nullA text URI consisting of '/typeahead/browse/' followed by a datasource (e.g. 'PhabricatorPeopleDatasource/') and optionally URI parameters. Returns null if not browsable.

private function newURIParameters()

This method is not documented.
Return
arrayArray with key 'parameters' and value consisting of JSON encoded parameters.

abstract public function getPlaceholderText()

This method is not documented.
Return
stringPlaceholder text to display in the empty datasource field field to provide a hint to the user, for example 'Type a user'

public function getBrowseTitle()

This method is not documented.
Return
stringTitle to display in the selection popup dialog created after selecting the magnifier icon, for example 'Browse Projects'

abstract public function getDatasourceApplicationClass()

This method is not documented.
Return
wild

abstract public function loadResults()

This method is not documented.
Return
wild

protected function loadResultsForPhase($phase, $limit)

This method is not documented.
Parameters
string$phase$phase
int$limit$limit
Return
wild

protected function didLoadResults($results)

This method is not documented.
Parameters
array$results
Return
wild

public static function tokenizeString($string)

This method is not documented.
Parameters
$string
Return
array<string>

public function getTokens()

Break search term entered in typeahead field into string tokens

Return
array<string>

protected function executeQuery($query)

This method is not documented.
Parameters
PhabricatorCursorPagedPolicyAwareQuery$query
Return
wild

public function isBrowsable()

Can the user browse through results from this datasource?

Browsable datasources allow the user to switch from typeahead mode to a browse mode where they can scroll through all results.

By default, datasources are browsable, but some datasources can not generate a meaningful result set or can't filter results on the server.

Return
bool

protected function filterResultsAgainstTokens($results)

Filter a list of results, removing items which don't match the query tokens.

This is useful for datasources which return a static list of hard-coded or configured results and can't easily do query filtering in a real query class. Instead, they can just build the entire result set and use this method to filter it.

For datasources backed by database objects, this is often much less efficient than filtering at the query level.

Parameters
list<PhabricatorTypeaheadResult>$resultsList of typeahead results.
Return
list<PhabricatorTypeaheadResult>Filtered results.

protected function newFunctionResult()

This method is not documented.
Return
wild

public function newInvalidToken($name)

This method is not documented.
Parameters
$name
Return
wild

public function renderTokens($values)

This method is not documented.
Parameters
array$values
Return
wild

protected function renderSpecialTokens($values)

This method is not documented.
Parameters
array$values
Return
wild

public function getDatasourceFunctions()

Return available function tokens for this typeahead datasource, with each key being the function name (e.g. any, not, null, only) and each value being another array containing name, summary, description. See the "Function Quick Reference" in the Typeahead Function Help for details.

Return
array<array<string>|null>

public function getAllDatasourceFunctions()

Return all function tokens for typeahead datasources, with each key being the function name (e.g. any, not, null, only) and each value being another array containing name, summary, description. See the "Function Quick Reference" in the Typeahead Function Help for details.

Return
array<array<string>>

protected function isFunctionWithLoginRequired($function)

Check if this datasource requires a logged-in viewer.

Parameters
string$functionFunction name.
Return
bool

protected function canEvaluateFunction($function)

This method is not documented.
Parameters
$function
Return
wild

protected function shouldStripFunction($function)

This method is not documented.
Parameters
$function
Return
wild

protected function evaluateFunction($function, $argv_list)

This method is not documented.
Parameters
$function
array$argv_list
Return
wild

protected function evaluateValues($values)

This method is not documented.
Parameters
array$values
Return
wild

public function evaluateTokens($tokens)

This method is not documented.
Parameters
array$tokens
Return
wild

protected function didEvaluateTokens($results)

This method is not documented.
Parameters
array$results
Return
wild

public static function isFunctionToken($token)

This method is not documented.
Parameters
string$token$token
Return
bool

protected function parseFunction($token, $allow_partial)

This method is not documented.
Parameters
$token
$allow_partial
Return
wild

public function renderFunctionTokens($function, $argv_list)

This method is not documented.
Parameters
$function
array$argv_list
Return
wild

public function setFunctionStack($function_stack)

This method is not documented.
Parameters
array$function_stack
Return
wild

public function getFunctionStack()

Get the function tokens entered in the typeahead field, e.g. "not" or "any"

Return
array<string|null>

protected function getCurrentFunction()

This method is not documented.
Return
array<PhabricatorTypeaheadTokenView>

protected function renderTokensFromResults($results, $values)

This method is not documented.
Parameters
array$results
array$values
Return
wild

public function getWireTokens($values)

This method is not documented.
Parameters
array$values
Return
wild

final protected function applyFerretConstraints($query, $engine, $ferret_function, $raw_query)

This method is not documented.
Parameters
PhabricatorCursorPagedPolicyAwareQuery$query
PhabricatorFerretEngine$engine
$ferret_function
$raw_query
Return
wild