3 final class AphlictDropdownDataQuery
extends Phobject
{
6 private $notificationData;
7 private $conpherenceData;
9 public function setViewer(PhabricatorUser
$viewer) {
10 $this->viewer
= $viewer;
14 public function getViewer() {
18 private function setNotificationData(array $data) {
19 $this->notificationData
= $data;
23 public function getNotificationData() {
24 if ($this->notificationData
=== null) {
25 throw new Exception(pht('You must %s first!', 'execute()'));
27 return $this->notificationData
;
30 private function setConpherenceData(array $data) {
31 $this->conpherenceData
= $data;
35 public function getConpherenceData() {
36 if ($this->conpherenceData
=== null) {
37 throw new Exception(pht('You must %s first!', 'execute()'));
39 return $this->conpherenceData
;
42 public function execute() {
43 $viewer = $this->getViewer();
45 $conpherence_app = 'PhabricatorConpherenceApplication';
46 $is_c_installed = PhabricatorApplication
::isClassInstalledForViewer(
49 if ($is_c_installed) {
50 $raw_message_count_number = $viewer->getUnreadMessageCount();
51 $message_count_number = $this->formatNumber($raw_message_count_number);
53 $raw_message_count_number = null;
54 $message_count_number = null;
58 $conpherence_data = array(
59 'isInstalled' => $is_c_installed,
60 'countType' => 'messages',
61 'count' => $message_count_number,
62 'rawCount' => $raw_message_count_number,
64 $this->setConpherenceData($conpherence_data);
66 $notification_app = 'PhabricatorNotificationsApplication';
67 $is_n_installed = PhabricatorApplication
::isClassInstalledForViewer(
70 if ($is_n_installed) {
71 $raw_notification_count_number = $viewer->getUnreadNotificationCount();
72 $notification_count_number = $this->formatNumber(
73 $raw_notification_count_number);
75 $notification_count_number = null;
76 $raw_notification_count_number = null;
79 $notification_data = array(
80 'isInstalled' => $is_n_installed,
81 'countType' => 'notifications',
82 'count' => $notification_count_number,
83 'rawCount' => $raw_notification_count_number,
85 $this->setNotificationData($notification_data);
88 $notification_app => $this->getNotificationData(),
89 $conpherence_app => $this->getConpherenceData(),
93 private function formatNumber($number) {
96 $formatted = "\xE2\x88\x9E";