Page MenuHomePhabricator

D14586.id35287.diff
No OneTemporary

D14586.id35287.diff

diff --git a/src/applications/phame/storage/PhameBlog.php b/src/applications/phame/storage/PhameBlog.php
--- a/src/applications/phame/storage/PhameBlog.php
+++ b/src/applications/phame/storage/PhameBlog.php
@@ -7,6 +7,7 @@
PhabricatorSubscribableInterface,
PhabricatorFlaggableInterface,
PhabricatorProjectInterface,
+ PhabricatorDestructibleInterface,
PhabricatorApplicationTransactionInterface {
const MARKUP_FIELD_DESCRIPTION = 'markup:description';
@@ -320,6 +321,25 @@
return (bool)$this->getPHID();
}
+/* -( PhabricatorDestructibleInterface )----------------------------------- */
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ $this->openTransaction();
+
+ $blog = id(new PhameBlog())
+ ->loadAllWhere('phid = %s', $this->getPHID());
+ $posts = id(new PhamePost())
+ ->loadAllWhere('blogPHID = %s', $this->getPHID());
+ foreach ($posts as $post) {
+ $post->delete();
+ }
+ $this->delete();
+
+ $this->saveTransaction();
+ }
+
/* -( PhabricatorApplicationTransactionInterface )------------------------- */
diff --git a/src/applications/phame/storage/PhamePost.php b/src/applications/phame/storage/PhamePost.php
--- a/src/applications/phame/storage/PhamePost.php
+++ b/src/applications/phame/storage/PhamePost.php
@@ -8,6 +8,7 @@
PhabricatorProjectInterface,
PhabricatorApplicationTransactionInterface,
PhabricatorSubscribableInterface,
+ PhabricatorDestructibleInterface,
PhabricatorTokenReceiverInterface {
const MARKUP_FIELD_BODY = 'markup:body';
@@ -252,6 +253,18 @@
return $timeline;
}
+/* -( PhabricatorDestructibleInterface )----------------------------------- */
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ $this->openTransaction();
+ $post = id(new PhamePost())
+ ->loadAllWhere('phid = %s', $this->getPHID());
+ $this->delete();
+ $this->saveTransaction();
+ }
+
/* -( PhabricatorTokenReceiverInterface )---------------------------------- */

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 25, 3:07 PM (2 d, 19 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7741294
Default Alt Text
D14586.id35287.diff (2 KB)

Event Timeline