diff --git a/src/applications/pholio/storage/PholioMock.php b/src/applications/pholio/storage/PholioMock.php index e362341af2..f2ee8d555c 100644 --- a/src/applications/pholio/storage/PholioMock.php +++ b/src/applications/pholio/storage/PholioMock.php @@ -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(); + } + }