Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / almanac / query / AlmanacInterfaceSearchEngine.php
blob9a3c5bc8f0a992f740f85b126c38cc0c70ac31d7
1 <?php
3 final class AlmanacInterfaceSearchEngine
4 extends PhabricatorApplicationSearchEngine {
6 public function getResultTypeDescription() {
7 return pht('Almanac Interfaces');
10 public function getApplicationClassName() {
11 return 'PhabricatorAlmanacApplication';
14 public function newQuery() {
15 return new AlmanacInterfaceQuery();
18 protected function buildCustomSearchFields() {
19 return array(
20 id(new PhabricatorPHIDsSearchField())
21 ->setLabel(pht('Devices'))
22 ->setKey('devicePHIDs')
23 ->setAliases(array('device', 'devicePHID', 'devices'))
24 ->setDescription(pht('Search for interfaces on particular devices.')),
28 protected function buildQueryFromParameters(array $map) {
29 $query = $this->newQuery();
31 if ($map['devicePHIDs']) {
32 $query->withDevicePHIDs($map['devicePHIDs']);
35 return $query;
38 protected function getURI($path) {
39 return '/almanac/interface/'.$path;
42 protected function getBuiltinQueryNames() {
43 $names = array(
44 'all' => pht('All Interfaces'),
47 return $names;
50 public function buildSavedQueryFromBuiltin($query_key) {
51 $query = $this->newSavedQuery();
52 $query->setQueryKey($query_key);
54 switch ($query_key) {
55 case 'all':
56 return $query;
59 return parent::buildSavedQueryFromBuiltin($query_key);
62 protected function renderResultList(
63 array $devices,
64 PhabricatorSavedQuery $query,
65 array $handles) {
67 // For now, this SearchEngine just supports API access via Conduit.
68 throw new PhutilMethodNotImplementedException();