Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14351675
D10345.id.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
D10345.id.diff
View Options
diff --git a/src/applications/ponder/storage/PonderAnswer.php b/src/applications/ponder/storage/PonderAnswer.php
--- a/src/applications/ponder/storage/PonderAnswer.php
+++ b/src/applications/ponder/storage/PonderAnswer.php
@@ -7,7 +7,8 @@
PhabricatorPolicyInterface,
PhabricatorFlaggableInterface,
PhabricatorSubscribableInterface,
- PhabricatorTokenReceiverInterface {
+ PhabricatorTokenReceiverInterface,
+ PhabricatorDestructibleInterface {
const MARKUP_FIELD_CONTENT = 'markup:content';
@@ -195,4 +196,16 @@
return true;
}
+
+/* -( PhabricatorDestructibleInterface )----------------------------------- */
+
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ $this->openTransaction();
+ $this->delete();
+ $this->saveTransaction();
+ }
+
}
diff --git a/src/applications/ponder/storage/PonderQuestion.php b/src/applications/ponder/storage/PonderQuestion.php
--- a/src/applications/ponder/storage/PonderQuestion.php
+++ b/src/applications/ponder/storage/PonderQuestion.php
@@ -8,7 +8,8 @@
PhabricatorFlaggableInterface,
PhabricatorPolicyInterface,
PhabricatorTokenReceiverInterface,
- PhabricatorProjectInterface {
+ PhabricatorProjectInterface,
+ PhabricatorDestructibleInterface {
const MARKUP_FIELD_CONTENT = 'markup:content';
@@ -247,4 +248,22 @@
);
}
+
+/* -( PhabricatorDestructibleInterface )----------------------------------- */
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ $this->openTransaction();
+ $answers = id(new PonderAnswer())->loadAllWhere(
+ 'questionID = %d',
+ $this->getID());
+ foreach ($answers as $answer) {
+ $engine->destroyObject($answer);
+ }
+
+ $this->delete();
+ $this->saveTransaction();
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 9:24 AM (15 h, 37 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6910069
Default Alt Text
D10345.id.diff (1 KB)
Attached To
Mode
D10345: Allow Ponder questions and answers to be destroyed with bin/remove
Attached
Detach File
Event Timeline
Log In to Comment