Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phriction/query/PhrictionDocumentSearchEngine.php
Show All 17 Lines | final class PhrictionDocumentSearchEngine | ||||
protected function buildQueryFromParameters(array $map) { | protected function buildQueryFromParameters(array $map) { | ||||
$query = $this->newQuery(); | $query = $this->newQuery(); | ||||
if ($map['statuses']) { | if ($map['statuses']) { | ||||
$query->withStatuses($map['statuses']); | $query->withStatuses($map['statuses']); | ||||
} | } | ||||
if ($map['paths']) { | |||||
$query->withSlugs($map['paths']); | |||||
} | |||||
return $query; | return $query; | ||||
} | } | ||||
protected function buildCustomSearchFields() { | protected function buildCustomSearchFields() { | ||||
return array( | return array( | ||||
id(new PhabricatorSearchCheckboxesField()) | id(new PhabricatorSearchCheckboxesField()) | ||||
->setKey('statuses') | ->setKey('statuses') | ||||
->setLabel(pht('Status')) | ->setLabel(pht('Status')) | ||||
->setOptions(PhrictionDocumentStatus::getStatusMap()), | ->setOptions(PhrictionDocumentStatus::getStatusMap()), | ||||
id(new PhabricatorSearchStringListField()) | |||||
->setKey('paths') | |||||
->setIsHidden(true) | |||||
->setLabel(pht('Paths')), | |||||
); | ); | ||||
} | } | ||||
protected function getURI($path) { | protected function getURI($path) { | ||||
return '/phriction/'.$path; | return '/phriction/'.$path; | ||||
} | } | ||||
protected function getBuiltinQueryNames() { | protected function getBuiltinQueryNames() { | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |