1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42: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:
epriestley 2017-03-24 09:13:37 -07:00
parent 0ffde484e5
commit daeb94561f

View file

@ -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();
}