Differential D14768 Diff 35723 src/applications/search/engine/PhabricatorApplicationSearchEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/engine/PhabricatorApplicationSearchEngine.php
Show First 20 Lines • Show All 1,062 Lines • ▼ Show 20 Lines | foreach ($standard_fields as $field_key => $field) { | ||||
$other_key, | $other_key, | ||||
get_class($other), | get_class($other), | ||||
$conduit_key)); | $conduit_key)); | ||||
} | } | ||||
$fields[$conduit_key] = $field; | $fields[$conduit_key] = $field; | ||||
} | } | ||||
$viewer = $this->requireViewer(); | |||||
foreach ($fields as $key => $field) { | |||||
$field->setViewer($viewer); | |||||
} | |||||
// These are handled separately for Conduit, so don't show them as | // These are handled separately for Conduit, so don't show them as | ||||
// supported. | // supported. | ||||
unset($fields['ids']); | unset($fields['ids']); | ||||
unset($fields['phids']); | unset($fields['phids']); | ||||
unset($fields['order']); | unset($fields['order']); | ||||
unset($fields['limit']); | unset($fields['limit']); | ||||
// TODO: Clean these up, shortly. | |||||
$fields = array( | |||||
'ids' => id(new PhabricatorSearchDatasourceField()) | |||||
->setKey('ids') | |||||
->setLabel(pht('IDs')) | |||||
->setDescription( | |||||
pht('Search for objects with specific IDs.')) | |||||
->setConduitParameterType(new ConduitIntListParameterType()), | |||||
'phids' => id(new PhabricatorSearchDatasourceField()) | |||||
->setKey('phids') | |||||
->setLabel(pht('PHIDs')) | |||||
->setDescription( | |||||
pht('Search for objects with specific PHIDs.')) | |||||
->setConduitParameterType(new ConduitPHIDListParameterType()), | |||||
) + $fields; | |||||
$viewer = $this->requireViewer(); | |||||
foreach ($fields as $key => $field) { | |||||
$field->setViewer($viewer); | |||||
} | |||||
return $fields; | return $fields; | ||||
} | } | ||||
public function buildConduitResponse(ConduitAPIRequest $request) { | public function buildConduitResponse(ConduitAPIRequest $request) { | ||||
$viewer = $this->requireViewer(); | $viewer = $this->requireViewer(); | ||||
$query_key = $request->getValue('queryKey'); | $query_key = $request->getValue('queryKey'); | ||||
if (!strlen($query_key)) { | if (!strlen($query_key)) { | ||||
▲ Show 20 Lines • Show All 223 Lines • Show Last 20 Lines |