Page MenuHomePhabricator

D11742.diff
No OneTemporary

D11742.diff

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

Mime Type
text/plain
Expires
Mon, Nov 18, 6:58 AM (2 d, 6 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6734327
Default Alt Text
D11742.diff (2 KB)

Event Timeline