Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/calendar/xaction/PhabricatorCalendarEventReplyTransaction.php
12256 views
1
<?php
2
3
abstract class PhabricatorCalendarEventReplyTransaction
4
extends PhabricatorCalendarEventTransactionType {
5
6
public function generateOldValue($object) {
7
$actor_phid = $this->getActingAsPHID();
8
return $object->getUserInviteStatus($actor_phid);
9
}
10
11
public function isInheritedEdit() {
12
return false;
13
}
14
15
public function applyExternalEffects($object, $value) {
16
$acting_phid = $this->getActingAsPHID();
17
18
$invitees = $object->getInvitees();
19
$invitees = mpull($invitees, null, 'getInviteePHID');
20
21
$invitee = idx($invitees, $acting_phid);
22
if (!$invitee) {
23
$invitee = id(new PhabricatorCalendarEventInvitee())
24
->setEventPHID($object->getPHID())
25
->setInviteePHID($acting_phid)
26
->setInviterPHID($acting_phid);
27
$invitees[$acting_phid] = $invitee;
28
}
29
30
$invitee
31
->setStatus($value)
32
->save();
33
34
$object->attachInvitees($invitees);
35
}
36
37
}
38
39