mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 19:40: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:
parent
de6349dd67
commit
92fc628b04
3 changed files with 8 additions and 6 deletions
|
@ -186,7 +186,7 @@ final class PhabricatorBadgesBadge extends PhabricatorBadgesDAO
|
|||
->execute();
|
||||
|
||||
foreach ($awards as $award) {
|
||||
$engine->destroyObjectPermanently($award);
|
||||
$engine->destroyObject($award);
|
||||
}
|
||||
|
||||
$this->openTransaction();
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -258,15 +258,15 @@ final class PhamePost extends PhameDAO
|
|||
return $timeline;
|
||||
}
|
||||
|
||||
|
||||
/* -( PhabricatorDestructibleInterface )----------------------------------- */
|
||||
|
||||
|
||||
public function destroyObjectPermanently(
|
||||
PhabricatorDestructionEngine $engine) {
|
||||
|
||||
$this->openTransaction();
|
||||
|
||||
$this->delete();
|
||||
|
||||
$this->saveTransaction();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue