Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13999676
D9775.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
D9775.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D9775: Allow Legalpad documents to be destroyed with `bin/remove destroy`
Attached
Detach File
Event Timeline
Log In to Comment