Page MenuHomePhabricator

D10563.id.diff
No OneTemporary

D10563.id.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
@@ -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

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)

Event Timeline