From 0a534d1d1f9b63d544f647f67d7a51ed8e3aff7b Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Sat, 7 Jun 2014 11:19:04 -0700 Subject: [PATCH] Allow herald rules to be deleted with `./bin/remove destroy`. Summary: Fixes T5286. Allow herald rules to be deleted using the `./bin/remove destroy` workflow. Test Plan: Created a herald rule. Deleted it with `./bin/remove destroy`. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Maniphest Tasks: T5286 Differential Revision: https://secure.phabricator.com/D9416 --- src/applications/herald/storage/HeraldRule.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/applications/herald/storage/HeraldRule.php b/src/applications/herald/storage/HeraldRule.php index d57be2dba5..28b0899b09 100644 --- a/src/applications/herald/storage/HeraldRule.php +++ b/src/applications/herald/storage/HeraldRule.php @@ -3,7 +3,8 @@ final class HeraldRule extends HeraldDAO implements PhabricatorFlaggableInterface, - PhabricatorPolicyInterface { + PhabricatorPolicyInterface, + PhabricatorDestructableInterface { const TABLE_RULE_APPLIED = 'herald_ruleapplied'; @@ -250,4 +251,15 @@ final class HeraldRule extends HeraldDAO return null; } + +/* -( PhabricatorDestructableInterface )----------------------------------- */ + + public function destroyObjectPermanently( + PhabricatorDestructionEngine $engine) { + + $this->openTransaction(); + $this->delete(); + $this->saveTransaction(); + } + }