Differential D20546 Diff 49020 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 48 Lines • ▼ Show 20 Lines | abstract class PhabricatorApplicationTransactionEditor | ||||
private $continueOnNoEffect; | private $continueOnNoEffect; | ||||
private $continueOnMissingFields; | private $continueOnMissingFields; | ||||
private $raiseWarnings; | private $raiseWarnings; | ||||
private $parentMessageID; | private $parentMessageID; | ||||
private $heraldAdapter; | private $heraldAdapter; | ||||
private $heraldTranscript; | private $heraldTranscript; | ||||
private $subscribers; | private $subscribers; | ||||
private $unmentionablePHIDMap = array(); | private $unmentionablePHIDMap = array(); | ||||
private $transactionGroupID; | |||||
private $applicationEmail; | private $applicationEmail; | ||||
private $isPreview; | private $isPreview; | ||||
private $isHeraldEditor; | private $isHeraldEditor; | ||||
private $isInverseEdgeEditor; | private $isInverseEdgeEditor; | ||||
private $actingAsPHID; | private $actingAsPHID; | ||||
private $heraldEmailPHIDs = array(); | private $heraldEmailPHIDs = array(); | ||||
▲ Show 20 Lines • Show All 905 Lines • ▼ Show 20 Lines | public function setCancelURI($cancel_uri) { | ||||
$this->cancelURI = $cancel_uri; | $this->cancelURI = $cancel_uri; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getCancelURI() { | public function getCancelURI() { | ||||
return $this->cancelURI; | return $this->cancelURI; | ||||
} | } | ||||
protected function getTransactionGroupID() { | |||||
if ($this->transactionGroupID === null) { | |||||
$this->transactionGroupID = Filesystem::readRandomCharacters(32); | |||||
} | |||||
return $this->transactionGroupID; | |||||
} | |||||
final public function applyTransactions( | final public function applyTransactions( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
array $xactions) { | array $xactions) { | ||||
$is_new = ($object->getID() === null); | $is_new = ($object->getID() === null); | ||||
$this->isNewObject = $is_new; | $this->isNewObject = $is_new; | ||||
$is_preview = $this->getIsPreview(); | $is_preview = $this->getIsPreview(); | ||||
▲ Show 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | try { | ||||
} catch (AphrontDuplicateKeyQueryException $ex) { | } catch (AphrontDuplicateKeyQueryException $ex) { | ||||
// This callback has an opportunity to throw a better exception, | // This callback has an opportunity to throw a better exception, | ||||
// so execution may end here. | // so execution may end here. | ||||
$this->didCatchDuplicateKeyException($object, $xactions, $ex); | $this->didCatchDuplicateKeyException($object, $xactions, $ex); | ||||
throw $ex; | throw $ex; | ||||
} | } | ||||
$group_id = Filesystem::readRandomCharacters(32); | $group_id = $this->getTransactionGroupID(); | ||||
foreach ($xactions as $xaction) { | foreach ($xactions as $xaction) { | ||||
if ($was_locked) { | if ($was_locked) { | ||||
$is_override = $this->isLockOverrideTransaction($xaction); | $is_override = $this->isLockOverrideTransaction($xaction); | ||||
if ($is_override) { | if ($is_override) { | ||||
$xaction->setIsLockOverrideTransaction(true); | $xaction->setIsLockOverrideTransaction(true); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 3,485 Lines • ▼ Show 20 Lines | $editor = id(clone $template) | ||||
->setParentMessageID($this->getParentMessageID()) | ->setParentMessageID($this->getParentMessageID()) | ||||
->setIsSilent($this->getIsSilent()); | ->setIsSilent($this->getIsSilent()); | ||||
if ($this->actingAsPHID !== null) { | if ($this->actingAsPHID !== null) { | ||||
$editor->setActingAsPHID($this->actingAsPHID); | $editor->setActingAsPHID($this->actingAsPHID); | ||||
} | } | ||||
$editor->mustEncrypt = $this->mustEncrypt; | $editor->mustEncrypt = $this->mustEncrypt; | ||||
$editor->transactionGroupID = $this->getTransactionGroupID(); | |||||
return $editor; | return $editor; | ||||
} | } | ||||
/* -( Stamps )------------------------------------------------------------- */ | /* -( Stamps )------------------------------------------------------------- */ | ||||
▲ Show 20 Lines • Show All 663 Lines • Show Last 20 Lines |