1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 21:02:41 +01:00

Allow structured destruction of Maniphest tasks

Summary:
Ref T4749. Ref T3265. Ref T4909.

  - Support ManiphestTasks in `bin/remove`.
  - Transactions need manual help for now.

Test Plan:
  - Destroyed tasks.
  - Examined log to verify task, transaction, and comment destruction.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T3265, T4749, T4909

Differential Revision: https://secure.phabricator.com/D8944
This commit is contained in:
epriestley 2014-05-05 10:55:19 -07:00
parent 74faacee4d
commit 6bced2170e

View file

@ -7,7 +7,8 @@ final class ManiphestTask extends ManiphestDAO
PhabricatorTokenReceiverInterface,
PhabricatorFlaggableInterface,
PhrequentTrackableInterface,
PhabricatorCustomFieldInterface {
PhabricatorCustomFieldInterface,
PhabricatorDestructableInterface {
const MARKUP_FIELD_DESCRIPTION = 'markup:desc';
@ -282,4 +283,26 @@ final class ManiphestTask extends ManiphestDAO
return $this;
}
/* -( PhabricatorDestructableInterface )----------------------------------- */
public function destroyObjectPermanently(
PhabricatorDestructionEngine $engine) {
$this->openTransaction();
// TODO: Once this implements PhabricatorTransactionInterface, this
// will be handled automatically and can be removed.
$xactions = id(new ManiphestTransaction())->loadAllWhere(
'objectPHID = %s',
$this->getPHID());
foreach ($xactions as $xaction) {
$engine->destroyObject($xaction);
}
$this->delete();
$this->saveTransaction();
}
}