@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3/**
4 * Holds bits and pieces of UI information for Search Engine
5 * and Dashboard Panel rendering, describing the results and
6 * controls for presentation.
7 */
8final class PhabricatorApplicationSearchResultView extends Phobject {
9
10 private $objectList = null;
11 private $table = null;
12 private $content = null;
13 private $infoView = null;
14 private $actions = array();
15 private $noDataString;
16 private $crumbs = array();
17 private $header;
18
19 public function setObjectList(PHUIObjectItemListView $list) {
20 $this->objectList = $list;
21 return $this;
22 }
23
24 public function getObjectList() {
25 $list = $this->objectList;
26 if ($list) {
27 if ($this->noDataString) {
28 $list->setNoDataString($this->noDataString);
29 } else {
30 $list->setNoDataString(pht('No results found for this query.'));
31 }
32 }
33 return $list;
34 }
35
36 public function setTable($table) {
37 $this->table = $table;
38 return $this;
39 }
40
41 public function getTable() {
42 return $this->table;
43 }
44
45 public function setInfoView(PHUIInfoView $infoview) {
46 $this->infoView = $infoview;
47 return $this;
48 }
49
50 /**
51 * @return PHUIInfoView
52 */
53 public function getInfoView() {
54 return $this->infoView;
55 }
56
57 public function setContent($content) {
58 $this->content = $content;
59 return $this;
60 }
61
62 public function getContent() {
63 return $this->content;
64 }
65
66 public function addAction(PHUIButtonView $button) {
67 $this->actions[] = $button;
68 return $this;
69 }
70
71 public function getActions() {
72 return $this->actions;
73 }
74
75 public function setNoDataString($nodata) {
76 $this->noDataString = $nodata;
77 return $this;
78 }
79
80 /**
81 * @param array<PHUICrumbView> $crumbs
82 */
83 public function setCrumbs(array $crumbs) {
84 assert_instances_of($crumbs, PHUICrumbView::class);
85
86 $this->crumbs = $crumbs;
87 return $this;
88 }
89
90 public function getCrumbs() {
91 return $this->crumbs;
92 }
93
94 public function setHeader(PHUIHeaderView $header) {
95 $this->header = $header;
96 return $this;
97 }
98
99 public function getHeader() {
100 return $this->header;
101 }
102
103}