Page MenuHomeGitPull.it
Diviner Tech Docs PhabricatorTokenDatasource

final class PhabricatorTokenDatasource
Phorge Technical Documentation (Tokens)

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)
Inherited

This method is not documented.
Parameters
$limit
Return
wild

public function getLimit()
Inherited

This method is not documented.
Return
wild

public function setOffset($offset)
Inherited

This method is not documented.
Parameters
$offset
Return
wild

public function getOffset()
Inherited

This method is not documented.
Return
wild

public function getViewer()
Inherited

This method is not documented.
Return
wild

public function setRawQuery($raw_query)
Inherited

This method is not documented.
Parameters
$raw_query
Return
wild

public function getPrefixQuery()
Inherited

This method is not documented.
Return
wild

public function getRawQuery()
Inherited

This method is not documented.
Return
wild

public function setQuery($query)
Inherited

This method is not documented.
Parameters
$query
Return
wild

public function getQuery()
Inherited

This method is not documented.
Return
wild

public function setParameters($params)
Inherited

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

public function getParameters()
Inherited

This method is not documented.
Return
wild

public function getParameter($name, $default)
Inherited

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

public function setIsBrowse($is_browse)
Inherited

This method is not documented.
Parameters
$is_browse
Return
wild

public function getIsBrowse()
Inherited

This method is not documented.
Return
wild

public function setPhase($phase)
Inherited

This method is not documented.
Parameters
$phase
Return
wild

public function getPhase()
Inherited

This method is not documented.
Return
wild

public function getDatasourceURI()
Inherited

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()
Inherited

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()
Inherited

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

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'
This method is not documented.
Return
wild

public function loadResults()

This method is not documented.
Return
wild

protected function loadResultsForPhase($phase, $limit)
Inherited

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

protected function didLoadResults($results)
Inherited

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

public static function tokenizeString($string)
Inherited

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

public function getTokens()
Inherited

PhabricatorTypeaheadDatasource

Break search term entered in typeahead field into string tokens

Return
array<string>

protected function executeQuery($query)
Inherited

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

public function isBrowsable()
Inherited

PhabricatorTypeaheadDatasource

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)
Inherited

PhabricatorTypeaheadDatasource

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()
Inherited

This method is not documented.
Return
wild

public function newInvalidToken($name)
Inherited

This method is not documented.
Parameters
$name
Return
wild

public function renderTokens($values)
Inherited

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

protected function renderSpecialTokens($values)
Inherited

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

public function getDatasourceFunctions()
Inherited

PhabricatorTypeaheadDatasource

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()
Inherited

PhabricatorTypeaheadDatasource

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)
Inherited

PhabricatorTypeaheadDatasource

Check if this datasource requires a logged-in viewer.

Parameters
string$functionFunction name.
Return
bool

protected function canEvaluateFunction($function)
Inherited

This method is not documented.
Parameters
$function
Return
wild

protected function shouldStripFunction($function)
Inherited

This method is not documented.
Parameters
$function
Return
wild

protected function evaluateFunction($function, $argv_list)
Inherited

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

protected function evaluateValues($values)
Inherited

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

public function evaluateTokens($tokens)
Inherited

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

protected function didEvaluateTokens($results)
Inherited

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

public static function isFunctionToken($token)
Inherited

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

protected function parseFunction($token, $allow_partial)
Inherited

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

public function renderFunctionTokens($function, $argv_list)
Inherited

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

public function setFunctionStack($function_stack)
Inherited

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

public function getFunctionStack()
Inherited

PhabricatorTypeaheadDatasource

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

Return
array<string|null>

protected function getCurrentFunction()
Inherited

This method is not documented.
Return
array<PhabricatorTypeaheadTokenView>

protected function renderTokensFromResults($results, $values)
Inherited

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

public function getWireTokens($values)
Inherited

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

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

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