@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow Legalpad documents to be destroyed with `bin/remove destroy`

Summary: Ref T3116. Support permanent destruction of legal document objects.

Test Plan: Ran `bin/remove destroy L1`, saw it clean up the document body, signatures, transactions and edges.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T3116

Differential Revision: https://secure.phabricator.com/D9775

+30 -1
+1
src/__phutil_library_map__.php
··· 3611 3611 1 => 'PhabricatorPolicyInterface', 3612 3612 2 => 'PhabricatorSubscribableInterface', 3613 3613 3 => 'PhabricatorApplicationTransactionInterface', 3614 + 4 => 'PhabricatorDestructableInterface', 3614 3615 ), 3615 3616 'LegalpadDocumentBody' => 3616 3617 array(
+29 -1
src/applications/legalpad/storage/LegalpadDocument.php
··· 4 4 implements 5 5 PhabricatorPolicyInterface, 6 6 PhabricatorSubscribableInterface, 7 - PhabricatorApplicationTransactionInterface { 7 + PhabricatorApplicationTransactionInterface, 8 + PhabricatorDestructableInterface { 8 9 9 10 protected $title; 10 11 protected $contributorCount; ··· 168 169 169 170 public function getApplicationTransactionTemplate() { 170 171 return new LegalpadTransaction(); 172 + } 173 + 174 + 175 + /* -( PhabricatorDestructableInterface )----------------------------------- */ 176 + 177 + 178 + public function destroyObjectPermanently( 179 + PhabricatorDestructionEngine $engine) { 180 + 181 + $this->openTransaction(); 182 + $this->delete(); 183 + 184 + $bodies = id(new LegalpadDocumentBody())->loadAllWhere( 185 + 'documentPHID = %s', 186 + $this->getPHID()); 187 + foreach ($bodies as $body) { 188 + $body->delete(); 189 + } 190 + 191 + $signatures = id(new LegalpadDocumentSignature())->loadAllWhere( 192 + 'documentPHID = %s', 193 + $this->getPHID()); 194 + foreach ($signatures as $signature) { 195 + $signature->delete(); 196 + } 197 + 198 + $this->saveTransaction(); 171 199 } 172 200 173 201 }