Differential D19807 Diff 47327 src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
Show First 20 Lines • Show All 863 Lines • ▼ Show 20 Lines | abstract class PhabricatorApplicationTransactionEditor | ||||
} | } | ||||
protected function applyFinalEffects( | protected function applyFinalEffects( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
array $xactions) { | array $xactions) { | ||||
return $xactions; | return $xactions; | ||||
} | } | ||||
final protected function didCommitTransactions( | |||||
PhabricatorLiskDAO $object, | |||||
array $xactions) { | |||||
foreach ($xactions as $xaction) { | |||||
$type = $xaction->getTransactionType(); | |||||
$xtype = $this->getModularTransactionType($type); | |||||
if (!$xtype) { | |||||
continue; | |||||
} | |||||
$xtype = clone $xtype; | |||||
$xtype->setStorage($xaction); | |||||
$xtype->didCommitTransaction($object, $xaction->getNewValue()); | |||||
} | |||||
} | |||||
public function setContentSource(PhabricatorContentSource $content_source) { | public function setContentSource(PhabricatorContentSource $content_source) { | ||||
$this->contentSource = $content_source; | $this->contentSource = $content_source; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setContentSourceFromRequest(AphrontRequest $request) { | public function setContentSourceFromRequest(AphrontRequest $request) { | ||||
return $this->setContentSource( | return $this->setContentSource( | ||||
PhabricatorContentSource::newFromRequest($request)); | PhabricatorContentSource::newFromRequest($request)); | ||||
▲ Show 20 Lines • Show All 221 Lines • ▼ Show 20 Lines | try { | ||||
$object->endReadLocking(); | $object->endReadLocking(); | ||||
$read_locking = false; | $read_locking = false; | ||||
} | } | ||||
if ($transaction_open) { | if ($transaction_open) { | ||||
$object->saveTransaction(); | $object->saveTransaction(); | ||||
$transaction_open = false; | $transaction_open = false; | ||||
} | } | ||||
$this->didCommitTransactions($object, $xactions); | |||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
if ($read_locking) { | if ($read_locking) { | ||||
$object->endReadLocking(); | $object->endReadLocking(); | ||||
$read_locking = false; | $read_locking = false; | ||||
} | } | ||||
if ($transaction_open) { | if ($transaction_open) { | ||||
$object->killTransaction(); | $object->killTransaction(); | ||||
▲ Show 20 Lines • Show All 3,460 Lines • Show Last 20 Lines |