3 final class AlmanacBindingSearchEngine
4 extends PhabricatorApplicationSearchEngine
{
6 public function getResultTypeDescription() {
7 return pht('Almanac Bindings');
10 public function getApplicationClassName() {
11 return 'PhabricatorAlmanacApplication';
14 public function newQuery() {
15 return new AlmanacBindingQuery();
18 protected function buildCustomSearchFields() {
20 id(new PhabricatorPHIDsSearchField())
21 ->setLabel(pht('Services'))
22 ->setKey('servicePHIDs')
23 ->setAliases(array('service', 'servicePHID', 'services'))
24 ->setDescription(pht('Search for bindings on particular services.')),
25 id(new PhabricatorPHIDsSearchField())
26 ->setLabel(pht('Devices'))
27 ->setKey('devicePHIDs')
28 ->setAliases(array('device', 'devicePHID', 'devices'))
29 ->setDescription(pht('Search for bindings on particular devices.')),
33 protected function buildQueryFromParameters(array $map) {
34 $query = $this->newQuery();
36 if ($map['servicePHIDs']) {
37 $query->withServicePHIDs($map['servicePHIDs']);
40 if ($map['devicePHIDs']) {
41 $query->withDevicePHIDs($map['devicePHIDs']);
47 protected function getURI($path) {
48 return '/almanac/binding/'.$path;
51 protected function getBuiltinQueryNames() {
53 'all' => pht('All Bindings'),
59 public function buildSavedQueryFromBuiltin($query_key) {
60 $query = $this->newSavedQuery();
61 $query->setQueryKey($query_key);
68 return parent
::buildSavedQueryFromBuiltin($query_key);
71 protected function renderResultList(
73 PhabricatorSavedQuery
$query,
76 // For now, this SearchEngine just supports API access via Conduit.
77 throw new PhutilMethodNotImplementedException();