Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / settings / panelgroup / PhabricatorSettingsPanelGroup.php
blobe828fa3b70247486a100a1f3e9689f8b76fe50cd
1 <?php
3 abstract class PhabricatorSettingsPanelGroup extends Phobject {
5 private $panels;
7 abstract public function getPanelGroupName();
9 protected function getPanelGroupOrder() {
10 return 1000;
13 final public function getPanelGroupOrderVector() {
14 return id(new PhutilSortVector())
15 ->addInt($this->getPanelGroupOrder())
16 ->addString($this->getPanelGroupName());
19 final public function getPanelGroupKey() {
20 return $this->getPhobjectClassConstant('PANELGROUPKEY');
23 final public static function getAllPanelGroups() {
24 $groups = id(new PhutilClassMapQuery())
25 ->setAncestorClass(__CLASS__)
26 ->setUniqueMethod('getPanelGroupKey')
27 ->execute();
29 return msortv($groups, 'getPanelGroupOrderVector');
32 final public static function getAllPanelGroupsWithPanels() {
33 $groups = self::getAllPanelGroups();
35 $panels = PhabricatorSettingsPanel::getAllPanels();
36 $panels = mgroup($panels, 'getPanelGroupKey');
37 foreach ($groups as $key => $group) {
38 $group->panels = idx($panels, $key, array());
41 return $groups;
44 public function getPanels() {
45 return $this->panels;