Page MenuHomePhabricator

D9775.diff
No OneTemporary

D9775.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -3611,6 +3611,7 @@
1 => 'PhabricatorPolicyInterface',
2 => 'PhabricatorSubscribableInterface',
3 => 'PhabricatorApplicationTransactionInterface',
+ 4 => 'PhabricatorDestructableInterface',
),
'LegalpadDocumentBody' =>
array(
diff --git a/src/applications/legalpad/storage/LegalpadDocument.php b/src/applications/legalpad/storage/LegalpadDocument.php
--- a/src/applications/legalpad/storage/LegalpadDocument.php
+++ b/src/applications/legalpad/storage/LegalpadDocument.php
@@ -4,7 +4,8 @@
implements
PhabricatorPolicyInterface,
PhabricatorSubscribableInterface,
- PhabricatorApplicationTransactionInterface {
+ PhabricatorApplicationTransactionInterface,
+ PhabricatorDestructableInterface {
protected $title;
protected $contributorCount;
@@ -170,4 +171,31 @@
return new LegalpadTransaction();
}
+
+/* -( PhabricatorDestructableInterface )----------------------------------- */
+
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ $this->openTransaction();
+ $this->delete();
+
+ $bodies = id(new LegalpadDocumentBody())->loadAllWhere(
+ 'documentPHID = %s',
+ $this->getPHID());
+ foreach ($bodies as $body) {
+ $body->delete();
+ }
+
+ $signatures = id(new LegalpadDocumentSignature())->loadAllWhere(
+ 'documentPHID = %s',
+ $this->getPHID());
+ foreach ($signatures as $signature) {
+ $signature->delete();
+ }
+
+ $this->saveTransaction();
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Fri, Oct 25, 4:24 PM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6718379
Default Alt Text
D9775.diff (1 KB)

Event Timeline