mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 04:20:55 +01:00
Allow Pholio mocks to be destroyed with bin/remove
Summary: Implements the destruction interface so mocks can be permanently destroyed with `bin/remove destroy Mxxx`. Test Plan: Destroyed some mocks. Reviewers: chad Reviewed By: chad Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D9551
This commit is contained in:
parent
14e3c727cc
commit
e711a0ed30
1 changed files with 21 additions and 1 deletions
|
@ -8,7 +8,8 @@ final class PholioMock extends PholioDAO
|
|||
PhabricatorTokenReceiverInterface,
|
||||
PhabricatorFlaggableInterface,
|
||||
PhabricatorApplicationTransactionInterface,
|
||||
PhabricatorProjectInterface {
|
||||
PhabricatorProjectInterface,
|
||||
PhabricatorDestructableInterface {
|
||||
|
||||
const MARKUP_FIELD_DESCRIPTION = 'markup:description';
|
||||
|
||||
|
@ -256,4 +257,23 @@ final class PholioMock extends PholioDAO
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
/* -( PhabricatorDestructableInterface )----------------------------------- */
|
||||
|
||||
|
||||
public function destroyObjectPermanently(
|
||||
PhabricatorDestructionEngine $engine) {
|
||||
|
||||
$this->openTransaction();
|
||||
$images = id(new PholioImage())->loadAllWhere(
|
||||
'mockID = %d',
|
||||
$this->getID());
|
||||
foreach ($images as $image) {
|
||||
$image->delete();
|
||||
}
|
||||
|
||||
$this->delete();
|
||||
$this->saveTransaction();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue