Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/calendar/herald/PhabricatorCalendarEventHeraldAdapter.php
12256 views
1
<?php
2
3
final class PhabricatorCalendarEventHeraldAdapter extends HeraldAdapter {
4
5
private $object;
6
7
public function getAdapterApplicationClass() {
8
return 'PhabricatorCalendarApplication';
9
}
10
11
public function getAdapterContentDescription() {
12
return pht('React to events being created or updated.');
13
}
14
15
protected function newObject() {
16
return new PhabricatorCalendarEvent();
17
}
18
19
public function isTestAdapterForObject($object) {
20
return ($object instanceof PhabricatorCalendarEvent);
21
}
22
23
public function getAdapterTestDescription() {
24
return pht(
25
'Test rules which run when an event is created or updated.');
26
}
27
28
public function setObject($object) {
29
$this->object = $object;
30
return $this;
31
}
32
33
public function getObject() {
34
return $this->object;
35
}
36
37
public function getAdapterContentName() {
38
return pht('Calendar Events');
39
}
40
41
public function supportsRuleType($rule_type) {
42
switch ($rule_type) {
43
case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL:
44
case HeraldRuleTypeConfig::RULE_TYPE_PERSONAL:
45
return true;
46
case HeraldRuleTypeConfig::RULE_TYPE_OBJECT:
47
default:
48
return false;
49
}
50
}
51
52
public function getHeraldName() {
53
return $this->getObject()->getMonogram();
54
}
55
56
}
57
58