Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/harbormaster/stepgroup/HarbormasterBuildStepGroup.php
12256 views
1
<?php
2
3
abstract class HarbormasterBuildStepGroup extends Phobject {
4
5
abstract public function getGroupName();
6
abstract public function getGroupOrder();
7
8
public function isEnabled() {
9
return true;
10
}
11
12
public function shouldShowIfEmpty() {
13
return true;
14
}
15
16
final public function getGroupKey() {
17
return $this->getPhobjectClassConstant('GROUPKEY');
18
}
19
20
final public static function getAllGroups() {
21
return id(new PhutilClassMapQuery())
22
->setAncestorClass(__CLASS__)
23
->setUniqueMethod('getGroupKey')
24
->setSortMethod('getGroupOrder')
25
->execute();
26
}
27
28
final public static function getAllEnabledGroups() {
29
$groups = self::getAllGroups();
30
31
foreach ($groups as $key => $group) {
32
if (!$group->isEnabled()) {
33
unset($groups[$key]);
34
}
35
}
36
37
return $groups;
38
}
39
40
}
41
42