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:
parent
de6349dd67
commit
92fc628b04
3 changed files with 8 additions and 6 deletions
|
@ -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();
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue