Changeset View
Changeset View
Standalone View
Standalone View
src/applications/almanac/typeahead/AlmanacServiceDatasource.php
<?php | <?php | ||||
final class AlmanacServiceDatasource | final class AlmanacServiceDatasource | ||||
extends PhabricatorTypeaheadDatasource { | extends PhabricatorTypeaheadDatasource { | ||||
public function getBrowseTitle() { | public function getBrowseTitle() { | ||||
return pht('Browse Services'); | return pht('Browse Services'); | ||||
} | } | ||||
public function getPlaceholderText() { | public function getPlaceholderText() { | ||||
return pht('Type a service name...'); | return pht('Type a service name...'); | ||||
} | } | ||||
public function getDatasourceApplicationClass() { | public function getDatasourceApplicationClass() { | ||||
return 'PhabricatorAlmanacApplication'; | return PhabricatorAlmanacApplication::class; | ||||
} | } | ||||
public function loadResults() { | public function loadResults() { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$raw_query = $this->getRawQuery(); | $raw_query = $this->getRawQuery(); | ||||
$services = id(new AlmanacServiceQuery()) | $services = id(new AlmanacServiceQuery()) | ||||
->withNamePrefix($raw_query) | ->withNamePrefix($raw_query) | ||||
Show All 34 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0