Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14356623
D10167.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10167.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D10167: Slowvote - add ability to destroy a poll
Attached
Detach File
Event Timeline
Log In to Comment