mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 14:00:56 +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,7 +1343,21 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
|
|||
PhabricatorDestructionEngine $engine) {
|
||||
|
||||
$this->openTransaction();
|
||||
$this->delete();
|
||||
$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->saveTransaction();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue