@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 Phriction documents to be permanently deleted

Summary: Allow `PhrictionDocument` to be permanently deleted with `./bin/remove destroy`.

Test Plan:
Deleted a Phriction document with `./bin/remove` and verified that the database was in the expected state.

```
> ./bin/remove destroy PHID-WIKI-auj57rauigvcqvv5feh6
IMPORTANT: OBJECTS WILL BE PERMANENTLY DESTROYED!

There is no way to undo this operation or ever retrieve this data.

These 1 object(s) will be completely destroyed forever:

- PHID-WIKI-auj57rauigvcqvv5feh6 (PhrictionDocument)

Are you absolutely certain you want to destroy these 1 object(s)? [y/N] y

Destroying objects...
Destroying PhrictionDocument PHID-WIKI-auj57rauigvcqvv5feh6...
Permanently destroyed 1 object(s).
```

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

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

+24 -1
+24 -1
src/applications/phriction/storage/PhrictionDocument.php
··· 5 5 PhabricatorPolicyInterface, 6 6 PhabricatorSubscribableInterface, 7 7 PhabricatorFlaggableInterface, 8 - PhabricatorTokenReceiverInterface { 8 + PhabricatorTokenReceiverInterface, 9 + PhabricatorDestructableInterface { 9 10 10 11 protected $slug; 11 12 protected $depth; ··· 180 181 public function getUsersToNotifyOfTokenGiven() { 181 182 return PhabricatorSubscribersQuery::loadSubscribersForPHID($this->phid); 182 183 } 184 + 185 + 186 + /* -( PhabricatorDestructableInterface )----------------------------------- */ 187 + 188 + 189 + public function destroyObjectPermanently( 190 + PhabricatorDestructionEngine $engine) { 191 + 192 + $this->openTransaction(); 193 + 194 + $this->delete(); 195 + 196 + $contents = id(new PhrictionContent())->loadAllWhere( 197 + 'documentID = %d', 198 + $this->getID()); 199 + foreach ($contents as $content) { 200 + $content->delete(); 201 + } 202 + 203 + $this->saveTransaction(); 204 + } 205 + 183 206 }