Differential D19909 Diff 47596 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 1,020 Lines • ▼ Show 20 Lines | final public function applyTransactions( | ||||
// transactions: if you try to apply an edit which you do not have | // transactions: if you try to apply an edit which you do not have | ||||
// permission to apply, we want to give you a permissions error even | // permission to apply, we want to give you a permissions error even | ||||
// if the edit would have no effect. | // if the edit would have no effect. | ||||
$this->applyCapabilityChecks($object, $xactions); | $this->applyCapabilityChecks($object, $xactions); | ||||
$xactions = $this->filterTransactions($object, $xactions); | $xactions = $this->filterTransactions($object, $xactions); | ||||
if (!$is_preview) { | if (!$is_preview) { | ||||
$this->willApplyTransactions($object, $xactions); | |||||
$this->hasRequiredMFA = true; | $this->hasRequiredMFA = true; | ||||
if ($this->getShouldRequireMFA()) { | if ($this->getShouldRequireMFA()) { | ||||
$this->requireMFA($object, $xactions); | $this->requireMFA($object, $xactions); | ||||
} | } | ||||
if ($object->getID()) { | if ($object->getID()) { | ||||
$this->buildOldRecipientLists($object, $xactions); | $this->buildOldRecipientLists($object, $xactions); | ||||
▲ Show 20 Lines • Show All 3,330 Lines • ▼ Show 20 Lines | private function getModularTransactionTypes() { | ||||
return $this->modularTypes; | return $this->modularTypes; | ||||
} | } | ||||
private function getModularTransactionType($type) { | private function getModularTransactionType($type) { | ||||
$types = $this->getModularTransactionTypes(); | $types = $this->getModularTransactionTypes(); | ||||
return idx($types, $type); | return idx($types, $type); | ||||
} | } | ||||
private function willApplyTransactions($object, array $xactions) { | |||||
foreach ($xactions as $xaction) { | |||||
$type = $xaction->getTransactionType(); | |||||
$xtype = $this->getModularTransactionType($type); | |||||
if (!$xtype) { | |||||
continue; | |||||
} | |||||
$xtype->willApplyTransactions($object, $xactions); | |||||
} | |||||
} | |||||
public function getCreateObjectTitle($author, $object) { | public function getCreateObjectTitle($author, $object) { | ||||
return pht('%s created this object.', $author); | return pht('%s created this object.', $author); | ||||
} | } | ||||
public function getCreateObjectTitleForFeed($author, $object) { | public function getCreateObjectTitleForFeed($author, $object) { | ||||
return pht('%s created an object: %s.', $author, $object); | return pht('%s created an object: %s.', $author, $object); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 517 Lines • Show Last 20 Lines |