Differential D20121 Diff 48057 src/applications/transactions/storage/PhabricatorApplicationTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | private function getApplicationObjectTypeName() { | ||||
if ($type) { | if ($type) { | ||||
return $type->getTypeName(); | return $type->getTypeName(); | ||||
} | } | ||||
return pht('Object'); | return pht('Object'); | ||||
} | } | ||||
public function getApplicationTransactionCommentObject() { | public function getApplicationTransactionCommentObject() { | ||||
throw new PhutilMethodNotImplementedException(); | return null; | ||||
epriestley: This is the culprit responsible for this mess. | |||||
} | } | ||||
public function getMetadataValue($key, $default = null) { | public function getMetadataValue($key, $default = null) { | ||||
return idx($this->metadata, $key, $default); | return idx($this->metadata, $key, $default); | ||||
} | } | ||||
public function setMetadataValue($key, $value) { | public function setMetadataValue($key, $value) { | ||||
$this->metadata[$key] = $value; | $this->metadata[$key] = $value; | ||||
▲ Show 20 Lines • Show All 1,638 Lines • ▼ Show 20 Lines | |||||
/* -( PhabricatorDestructibleInterface )----------------------------------- */ | /* -( PhabricatorDestructibleInterface )----------------------------------- */ | ||||
public function destroyObjectPermanently( | public function destroyObjectPermanently( | ||||
PhabricatorDestructionEngine $engine) { | PhabricatorDestructionEngine $engine) { | ||||
$this->openTransaction(); | $this->openTransaction(); | ||||
$comment_template = null; | |||||
try { | |||||
$comment_template = $this->getApplicationTransactionCommentObject(); | $comment_template = $this->getApplicationTransactionCommentObject(); | ||||
} catch (Exception $ex) { | |||||
// Continue; no comments for these transactions. | |||||
} | |||||
if ($comment_template) { | if ($comment_template) { | ||||
$comments = $comment_template->loadAllWhere( | $comments = $comment_template->loadAllWhere( | ||||
'transactionPHID = %s', | 'transactionPHID = %s', | ||||
$this->getPHID()); | $this->getPHID()); | ||||
foreach ($comments as $comment) { | foreach ($comments as $comment) { | ||||
$engine->destroyObject($comment); | $engine->destroyObject($comment); | ||||
} | } | ||||
} | } | ||||
$this->delete(); | $this->delete(); | ||||
$this->saveTransaction(); | $this->saveTransaction(); | ||||
} | } | ||||
} | } |
This is the culprit responsible for this mess.