Differential D12528 Diff 30088 src/applications/search/typeahead/PhabricatorSearchDocumentTypeDatasource.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/typeahead/PhabricatorSearchDocumentTypeDatasource.php
Show All 15 Lines | final class PhabricatorSearchDocumentTypeDatasource | ||||
} | } | ||||
public function loadResults() { | public function loadResults() { | ||||
$results = $this->buildResults(); | $results = $this->buildResults(); | ||||
return $this->filterResultsAgainstTokens($results); | return $this->filterResultsAgainstTokens($results); | ||||
} | } | ||||
public function renderTokens(array $values) { | public function renderTokens(array $values) { | ||||
$results = $this->buildResults(); | return $this->renderTokensFromResults($this->buildResults(), $values); | ||||
$results = array_select_keys($results, $values); | |||||
$tokens = array(); | |||||
foreach ($results as $result) { | |||||
$tokens[] = PhabricatorTypeaheadTokenView::newFromTypeaheadResult( | |||||
$result); | |||||
} | |||||
return $tokens; | |||||
} | } | ||||
private function buildResults() { | private function buildResults() { | ||||
$types = | $types = | ||||
PhabricatorSearchApplicationSearchEngine::getIndexableDocumentTypes(); | PhabricatorSearchApplicationSearchEngine::getIndexableDocumentTypes(); | ||||
$icons = mpull( | $icons = mpull( | ||||
PhabricatorPHIDType::getAllTypes(), | PhabricatorPHIDType::getAllTypes(), | ||||
Show All 15 Lines |