Page MenuHomePhabricator
Diviner Phabricator Tech Docs PhabricatorSearchField

abstract class PhabricatorSearchField
Phabricator Technical Documentation (Search)

This class is not documented.

Tasks

Configuring Fields

  • public function setKey($key) — Set the primary key for the field, like `projectPHIDs`.
  • public function getKey() — Get the field's key.
  • public function getLabel() — Get the field's human-readable label.
  • public function setViewer($viewer) — Set the acting viewer.
  • public function getViewer() — Get the acting viewer.
  • public function setAliases($aliases) — Provide alternate field aliases, usually more human-readable versions of the key.
  • public function getAliases() — Get aliases for this field.
  • public function setConduitKey($conduit_key) — Provide an alternate field key for Conduit.
  • public function getConduitKey() — Get the field key for use in Conduit.
  • public function setDescription($description) — Set a human-readable description for this field.
  • public function getDescription() — Get this field's human-readable description.
  • public function setIsHidden($is_hidden) — Hide this field from the web UI.
  • public function getIsHidden() — Should this field be hidden from the web UI?

Handling Errors

No methods for this task.

Reading and Writing Field Values

No methods for this task.

Integration with Conduit

Utility Methods

No methods for this task.

Other Methods

utility

  • protected function getListFromRequest($request, $key) — Read a list of items from the request, in either array format or string format:

Methods

public function setKey($key)

Set the primary key for the field, like projectPHIDs.

You can set human-readable aliases with setAliases().

The key should be a short, unique (within a search engine) string which does not contain any special characters.

Parameters
string$keyUnique key which identifies the field.
Return
this

public function getKey()

Get the field's key.

Return
stringUnique key for this field.

public function setLabel($label)

Set a human-readable label for the field.

This should be a short text string, like "Reviewers" or "Colors".

Parameters
string$labelShort, human-readable field label.
Return
thistask config

public function getLabel()

Get the field's human-readable label.

Return
stringShort, human-readable field label.

public function setViewer($viewer)

Set the acting viewer.

Engines do not need to do this explicitly; it will be done on their behalf by the caller.

Parameters
PhabricatorUser$viewerViewer.
Return
this

public function getViewer()

Get the acting viewer.

Return
PhabricatorUserViewer.

public function setAliases($aliases)

Provide alternate field aliases, usually more human-readable versions of the key.

These aliases can be used when building GET requests, so you can provide an alias like authors to let users write &authors=alincoln instead of &authorPHIDs=alincoln. This is a little easier to use.

Parameters
list<string>$aliasesList of aliases for this field.
Return
this

public function getAliases()

Get aliases for this field.

Return
list<string>List of aliases for this field.

public function setConduitKey($conduit_key)

Provide an alternate field key for Conduit.

This can allow you to choose a more usable key for API endpoints. If no key is provided, the main key is used.

Parameters
string$conduit_keyAlternate key for Conduit.
Return
this

public function getConduitKey()

Get the field key for use in Conduit.

Return
stringConduit key for this field.

public function setDescription($description)

Set a human-readable description for this field.

Parameters
string$descriptionHuman-readable description.
Return
this

public function getDescription()

Get this field's human-readable description.

Return
string|nullHuman-readable description.

public function setIsHidden($is_hidden)

Hide this field from the web UI.

Parameters
bool$is_hiddenTrue to hide the field from the web UI.
Return
this

public function getIsHidden()

Should this field be hidden from the web UI?

Return
boolTrue to hide the field in the web UI.

protected function addError($short, $long)

This method is not documented.
Parameters
$short
$long
Return
wild

public function getErrors()

This method is not documented.
Return
wild

protected function validateControlValue($value)

This method is not documented.
Parameters
$value
Return
wild

protected function getShortError()

This method is not documented.
Return
wild

public function readValueFromRequest($request)

This method is not documented.
Parameters
AphrontRequest$request
Return
wild

protected function getValueExistsInRequest($request, $key)

This method is not documented.
Parameters
AphrontRequest$request
$key
Return
wild

abstract protected function getValueFromRequest($request, $key)

This method is not documented.
Parameters
AphrontRequest$request
$key
Return
wild

public function readValueFromSavedQuery($saved)

This method is not documented.
Parameters
PhabricatorSavedQuery$saved
Return
wild

protected function didReadValueFromSavedQuery($value)

This method is not documented.
Parameters
$value
Return
wild

public function getValue()

This method is not documented.
Return
wild

protected function getValueForControl()

This method is not documented.
Return
wild

protected function getDefaultValue()

This method is not documented.
Return
wild

public function getValueForQuery($value)

This method is not documented.
Parameters
$value
Return
wild

protected function newControl()

This method is not documented.
Return
wild

protected function renderControl()

This method is not documented.
Return
wild

public function appendToForm($form)

This method is not documented.
Parameters
AphrontFormView$form
Return
wild

final public function getConduitParameterType()

This method is not documented.
Return
wild

protected function newConduitParameterType()

This method is not documented.
Return
wild

public function getValueExistsInConduitRequest($constraints)

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

public function readValueFromConduitRequest($constraints, $strict)

This method is not documented.
Parameters
array$constraints
$strict
Return
wild

public function getValidConstraintKeys()

This method is not documented.
Return
wild

final public function setEnableForConduit($enable)

This method is not documented.
Parameters
$enable
Return
wild

final public function getEnableForConduit()

This method is not documented.
Return
wild

public function newConduitConstants()

This method is not documented.
Return
wild

protected function getListFromRequest($request, $key)

Read a list of items from the request, in either array format or string format:

list[]=item1&list[]=item2
list=item1,item2

This provides flexibility when constructing URIs, especially from external sources.

Parameters
AphrontRequest$requestRequest to read strings from.
string$keyKey to read in the request.
Return
list<string>List of values.