Page MenuHomePhabricator

D10167.diff
No OneTemporary

D10167.diff

diff --git a/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php b/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php
--- a/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php
+++ b/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php
@@ -6,7 +6,8 @@
PhabricatorSubscribableInterface,
PhabricatorFlaggableInterface,
PhabricatorTokenReceiverInterface,
- PhabricatorProjectInterface {
+ PhabricatorProjectInterface,
+ PhabricatorDestructibleInterface {
const RESPONSES_VISIBLE = 0;
const RESPONSES_VOTERS = 1;
@@ -139,4 +140,26 @@
return array($this->getAuthorPHID());
}
+/* -( PhabricatorDestructableInterface )----------------------------------- */
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ $this->openTransaction();
+ $choices = id(new PhabricatorSlowvoteChoice())->loadAllWhere(
+ 'pollID = %d',
+ $this->getID());
+ foreach ($choices as $choice) {
+ $choice->delete();
+ }
+ $options = id(new PhabricatorSlowvoteOption())->loadAllWhere(
+ 'pollID = %d',
+ $this->getID());
+ foreach ($options as $option) {
+ $option->delete();
+ }
+ $this->delete();
+ $this->saveTransaction();
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 10:45 PM (16 h, 42 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6912172
Default Alt Text
D10167.diff (1 KB)

Event Timeline