Page MenuHomePhabricator

D9352.diff
No OneTemporary

D9352.diff

diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php
--- a/src/applications/project/storage/PhabricatorProject.php
+++ b/src/applications/project/storage/PhabricatorProject.php
@@ -5,7 +5,8 @@
PhabricatorFlaggableInterface,
PhabricatorPolicyInterface,
PhabricatorSubscribableInterface,
- PhabricatorCustomFieldInterface {
+ PhabricatorCustomFieldInterface,
+ PhabricatorDestructableInterface {
protected $name;
protected $status = PhabricatorProjectStatus::STATUS_ACTIVE;
@@ -247,4 +248,27 @@
}
+/* -( PhabricatorDestructableInterface )----------------------------------- */
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ $this->openTransaction();
+ $this->delete();
+
+ $columns = id(new PhabricatorProjectColumn())
+ ->loadAllWhere('projectPHID = %s', $this->getPHID());
+ foreach ($columns as $column) {
+ $engine->destroyObject($column);
+ }
+
+ $slugs = id(new PhabricatorProjectSlug())
+ ->loadAllWhere('projectPHID = %s', $this->getPHID());
+ foreach ($slugs as $slug) {
+ $slug->delete();
+ }
+
+ $this->saveTransaction();
+ }
+
}
diff --git a/src/applications/project/storage/PhabricatorProjectColumn.php b/src/applications/project/storage/PhabricatorProjectColumn.php
--- a/src/applications/project/storage/PhabricatorProjectColumn.php
+++ b/src/applications/project/storage/PhabricatorProjectColumn.php
@@ -2,7 +2,8 @@
final class PhabricatorProjectColumn
extends PhabricatorProjectDAO
- implements PhabricatorPolicyInterface {
+ implements PhabricatorPolicyInterface,
+ PhabricatorDestructableInterface {
const STATUS_ACTIVE = 0;
const STATUS_DELETED = 1;
@@ -87,4 +88,15 @@
return pht('Users must be able to see a project to see its board.');
}
+
+/* -( PhabricatorDestructableInterface )----------------------------------- */
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ $this->openTransaction();
+ $this->delete();
+ $this->saveTransaction();
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Fri, Mar 21, 10:23 PM (1 w, 1 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7385526
Default Alt Text
D9352.diff (2 KB)

Event Timeline