1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 03:50:54 +01:00

Better destruction of PhameBlog, BadgesBadge

Summary: Allows proper destruction of Badge Awards and Phame Posts.

Test Plan: bin/remove destroy PHID...

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D16182
This commit is contained in:
Chad Little 2016-06-27 17:07:03 -07:00
parent de6349dd67
commit 92fc628b04
3 changed files with 8 additions and 6 deletions

View file

@ -186,7 +186,7 @@ final class PhabricatorBadgesBadge extends PhabricatorBadgesDAO
->execute();
foreach ($awards as $award) {
$engine->destroyObjectPermanently($award);
$engine->destroyObject($award);
}
$this->openTransaction();

View file

@ -322,10 +322,12 @@ final class PhameBlog extends PhameDAO
$this->openTransaction();
$posts = id(new PhamePost())
->loadAllWhere('blogPHID = %s', $this->getPHID());
$posts = id(new PhamePostQuery())
->setViewer($engine->getViewer())
->withBlogPHIDs(array($this->getPHID()))
->execute();
foreach ($posts as $post) {
$post->delete();
$engine->destroyObject($post);
}
$this->delete();

View file

@ -258,15 +258,15 @@ final class PhamePost extends PhameDAO
return $timeline;
}
/* -( PhabricatorDestructibleInterface )----------------------------------- */
public function destroyObjectPermanently(
PhabricatorDestructionEngine $engine) {
$this->openTransaction();
$this->delete();
$this->saveTransaction();
}