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() {
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']);
38 protected function getURI($path) {
39 return '/almanac/interface/'.$path;
42 protected function getBuiltinQueryNames() {
44 'all' => pht('All Interfaces'),
50 public function buildSavedQueryFromBuiltin($query_key) {
51 $query = $this->newSavedQuery();
52 $query->setQueryKey($query_key);
59 return parent
::buildSavedQueryFromBuiltin($query_key);
62 protected function renderResultList(
64 PhabricatorSavedQuery
$query,
67 // For now, this SearchEngine just supports API access via Conduit.
68 throw new PhutilMethodNotImplementedException();