Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13991840
D11742.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
D11742.diff
View Options
diff --git a/src/applications/diviner/storage/DivinerLiveBook.php b/src/applications/diviner/storage/DivinerLiveBook.php
--- a/src/applications/diviner/storage/DivinerLiveBook.php
+++ b/src/applications/diviner/storage/DivinerLiveBook.php
@@ -1,7 +1,9 @@
<?php
final class DivinerLiveBook extends DivinerDAO
- implements PhabricatorPolicyInterface {
+ implements
+ PhabricatorPolicyInterface,
+ PhabricatorDestructibleInterface {
protected $name;
protected $viewPolicy;
@@ -82,4 +84,25 @@
return null;
}
+/* -( PhabricatorDestructibleInterface )----------------------------------- */
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ $this->openTransaction();
+ $atoms = id(new DivinerAtomQuery())
+ ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->withBookPHIDs(array($this->getPHID()))
+ ->withIncludeGhosts(true)
+ ->withIncludeUndocumentable(true)
+ ->execute();
+
+ foreach ($atoms as $atom) {
+ $engine->destroyObject($atom);
+ }
+
+ $this->delete();
+ $this->saveTransaction();
+ }
+
}
diff --git a/src/applications/diviner/storage/DivinerLiveSymbol.php b/src/applications/diviner/storage/DivinerLiveSymbol.php
--- a/src/applications/diviner/storage/DivinerLiveSymbol.php
+++ b/src/applications/diviner/storage/DivinerLiveSymbol.php
@@ -1,7 +1,10 @@
<?php
final class DivinerLiveSymbol extends DivinerDAO
- implements PhabricatorPolicyInterface, PhabricatorMarkupInterface {
+ implements
+ PhabricatorPolicyInterface,
+ PhabricatorMarkupInterface,
+ PhabricatorDestructibleInterface {
protected $bookPHID;
protected $context;
@@ -242,4 +245,22 @@
return true;
}
+/* -( PhabricatorDestructibleInterface )----------------------------------- */
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ $this->openTransaction();
+ $conn_w = $this->establishConnection('w');
+
+ queryfx(
+ $conn_w,
+ 'DELETE FROM %T WHERE symbolPHID = %s',
+ id(new DivinerLiveAtom())->getTableName(),
+ $this->getPHID());
+
+ $this->delete();
+ $this->saveTransaction();
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 23, 1:00 PM (4 w, 30 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6734327
Default Alt Text
D11742.diff (2 KB)
Attached To
Mode
D11742: Allow diviner books to be permanently destroyed
Attached
Detach File
Event Timeline
Log In to Comment