3 final class PhabricatorPackagesPublisherSearchEngine
4 extends PhabricatorApplicationSearchEngine
{
6 public function getResultTypeDescription() {
7 return pht('Package Publishers');
10 public function getApplicationClassName() {
11 return 'PhabricatorPackagesApplication';
14 public function newQuery() {
15 return id(new PhabricatorPackagesPublisherQuery());
18 public function canUseInPanelContext() {
22 protected function buildQueryFromParameters(array $map) {
23 $query = $this->newQuery();
25 if ($map['match'] !== null) {
26 $query->withNameNgrams($map['match']);
32 protected function buildCustomSearchFields() {
34 id(new PhabricatorSearchTextField())
35 ->setLabel(pht('Name Contains'))
37 ->setDescription(pht('Search for publishers by name substring.')),
41 protected function getURI($path) {
42 return '/packages/publisher/'.$path;
45 protected function getBuiltinQueryNames() {
47 'all' => pht('All Publishers'),
53 public function buildSavedQueryFromBuiltin($query_key) {
54 $query = $this->newSavedQuery();
55 $query->setQueryKey($query_key);
62 return parent
::buildSavedQueryFromBuiltin($query_key);
65 protected function renderResultList(
67 PhabricatorSavedQuery
$query,
70 assert_instances_of($publishers, 'PhabricatorPackagesPublisher');
72 $viewer = $this->requireViewer();
74 $list = id(new PhabricatorPackagesPublisherListView())
76 ->setPublishers($publishers)
79 return id(new PhabricatorApplicationSearchResultView())
80 ->setObjectList($list)
81 ->setNoDataString(pht('No publishers found.'));