mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52:41 +01:00
When destroying Calendar events, destroy invitees and notifications
Summary: Fixes T12395. Test Plan: Ran `bin/remove destroy E... --trace`, saw invitee and notification destruction. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12395 Differential Revision: https://secure.phabricator.com/D17555
This commit is contained in:
parent
0ffde484e5
commit
daeb94561f
1 changed files with 15 additions and 1 deletions
|
@ -1343,6 +1343,20 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
|
||||||
PhabricatorDestructionEngine $engine) {
|
PhabricatorDestructionEngine $engine) {
|
||||||
|
|
||||||
$this->openTransaction();
|
$this->openTransaction();
|
||||||
|
$invitees = id(new PhabricatorCalendarEventInvitee())->loadAllWhere(
|
||||||
|
'eventPHID = %s',
|
||||||
|
$this->getPHID());
|
||||||
|
foreach ($invitees as $invitee) {
|
||||||
|
$invitee->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
$notifications = id(new PhabricatorCalendarNotification())->loadAllWhere(
|
||||||
|
'eventPHID = %s',
|
||||||
|
$this->getPHID());
|
||||||
|
foreach ($notifications as $notification) {
|
||||||
|
$notification->delete();
|
||||||
|
}
|
||||||
|
|
||||||
$this->delete();
|
$this->delete();
|
||||||
$this->saveTransaction();
|
$this->saveTransaction();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue