1
0
Fork 0
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:
epriestley 2014-06-15 11:55:48 -07:00
parent 14e3c727cc
commit e711a0ed30

View file

@ -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();
}
}