Page MenuHomePhabricator

D10345.id.diff
No OneTemporary

D10345.id.diff

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

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)

Event Timeline