1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-21 04:50:55 +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(); ->execute();
foreach ($awards as $award) { foreach ($awards as $award) {
$engine->destroyObjectPermanently($award); $engine->destroyObject($award);
} }
$this->openTransaction(); $this->openTransaction();

View file

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

View file

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