Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18045377
D10563.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10563.id.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
@@ -4855,6 +4855,8 @@
'PhabricatorMentionableInterface',
'PhabricatorPolicyInterface',
'PhabricatorProjectInterface',
+ 'PhabricatorDestructibleInterface',
+ 'PhabricatorApplicationTransactionInterface',
),
'PhabricatorPasteApplication' => 'PhabricatorApplication',
'PhabricatorPasteCommentController' => 'PhabricatorPasteController',
diff --git a/src/applications/paste/storage/PhabricatorPaste.php b/src/applications/paste/storage/PhabricatorPaste.php
--- a/src/applications/paste/storage/PhabricatorPaste.php
+++ b/src/applications/paste/storage/PhabricatorPaste.php
@@ -7,7 +7,9 @@
PhabricatorFlaggableInterface,
PhabricatorMentionableInterface,
PhabricatorPolicyInterface,
- PhabricatorProjectInterface {
+ PhabricatorProjectInterface,
+ PhabricatorDestructibleInterface,
+ PhabricatorApplicationTransactionInterface {
protected $title;
protected $authorPHID;
@@ -152,4 +154,40 @@
return pht('The author of a paste can always view and edit it.');
}
+
+/* -( PhabricatorDestructibleInterface )----------------------------------- */
+
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ if ($this->filePHID) {
+ $file = id(new PhabricatorFileQuery())
+ ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->withPHIDs(array($this->filePHID))
+ ->executeOne();
+ if ($file) {
+ $engine->destroyObject($file);
+ }
+ }
+
+ $this->delete();
+ }
+
+
+/* -( PhabricatorApplicationTransactionInterface )------------------------- */
+
+
+ public function getApplicationTransactionEditor() {
+ return new PhabricatorPasteEditor();
+ }
+
+ public function getApplicationTransactionObject() {
+ return $this;
+ }
+
+ public function getApplicationTransactionTemplate() {
+ return new PhabricatorPasteTransaction();
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Aug 4, 8:54 AM (5 d, 7 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8750291
Default Alt Text
D10563.id.diff (2 KB)
Attached To
Mode
D10563: Allow pastes to be destroyed
Attached
Detach File
Event Timeline
Log In to Comment