Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13983359
D10283.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
D10283.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
@@ -4231,6 +4231,7 @@
'PhabricatorDashboard' => array(
'PhabricatorDashboardDAO',
'PhabricatorPolicyInterface',
+ 'PhabricatorDestructibleInterface',
),
'PhabricatorDashboardAddPanelController' => 'PhabricatorDashboardController',
'PhabricatorDashboardApplication' => 'PhabricatorApplication',
@@ -4249,6 +4250,7 @@
'PhabricatorDashboardDAO',
'PhabricatorPolicyInterface',
'PhabricatorCustomFieldInterface',
+ 'PhabricatorDestructibleInterface',
),
'PhabricatorDashboardPanelArchiveController' => 'PhabricatorDashboardController',
'PhabricatorDashboardPanelCoreCustomField' => array(
diff --git a/src/applications/dashboard/storage/PhabricatorDashboard.php b/src/applications/dashboard/storage/PhabricatorDashboard.php
--- a/src/applications/dashboard/storage/PhabricatorDashboard.php
+++ b/src/applications/dashboard/storage/PhabricatorDashboard.php
@@ -4,7 +4,9 @@
* A collection of dashboard panels with a specific layout.
*/
final class PhabricatorDashboard extends PhabricatorDashboardDAO
- implements PhabricatorPolicyInterface {
+ implements
+ PhabricatorPolicyInterface,
+ PhabricatorDestructibleInterface {
protected $name;
protected $viewPolicy;
@@ -104,4 +106,24 @@
return null;
}
+
+/* -( PhabricatorDestructibleInterface )----------------------------------- */
+
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ $this->openTransaction();
+ $installs = id(new PhabricatorDashboardInstall())->loadAllWhere(
+ 'dashboardPHID = %s',
+ $this->getPHID());
+ foreach ($installs as $install) {
+ $install->delete();
+ }
+
+ $this->delete();
+ $this->saveTransaction();
+ }
+
+
}
diff --git a/src/applications/dashboard/storage/PhabricatorDashboardPanel.php b/src/applications/dashboard/storage/PhabricatorDashboardPanel.php
--- a/src/applications/dashboard/storage/PhabricatorDashboardPanel.php
+++ b/src/applications/dashboard/storage/PhabricatorDashboardPanel.php
@@ -7,7 +7,8 @@
extends PhabricatorDashboardDAO
implements
PhabricatorPolicyInterface,
- PhabricatorCustomFieldInterface {
+ PhabricatorCustomFieldInterface,
+ PhabricatorDestructibleInterface {
protected $name;
protected $panelType;
@@ -131,4 +132,16 @@
return $this;
}
+
+/* -( PhabricatorDestructibleInterface )----------------------------------- */
+
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ $this->openTransaction();
+ $this->delete();
+ $this->saveTransaction();
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 21, 5:53 AM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6722007
Default Alt Text
D10283.diff (2 KB)
Attached To
Mode
D10283: Implement DestructibleInterface for dashboards and panels
Attached
Detach File
Event Timeline
Log In to Comment