Differential D8291 Diff 19730 src/applications/differential/editor/DifferentialTransactionEditor.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/editor/DifferentialTransactionEditor.php
| <?php | <?php | ||||
| final class DifferentialTransactionEditor | final class DifferentialTransactionEditor | ||||
| extends PhabricatorApplicationTransactionEditor { | extends PhabricatorApplicationTransactionEditor { | ||||
| public function getTransactionTypes() { | public function getTransactionTypes() { | ||||
| $types = parent::getTransactionTypes(); | $types = parent::getTransactionTypes(); | ||||
| $types[] = PhabricatorTransactions::TYPE_EDGE; | |||||
| $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY; | $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY; | ||||
| $types[] = PhabricatorTransactions::TYPE_EDIT_POLICY; | $types[] = PhabricatorTransactions::TYPE_EDIT_POLICY; | ||||
| /* | /* | ||||
| $types[] = PhabricatorTransactions::TYPE_EDGE; | |||||
| $types[] = DifferentialTransaction::TYPE_INLINE; | $types[] = DifferentialTransaction::TYPE_INLINE; | ||||
| $types[] = DifferentialTransaction::TYPE_UPDATE; | $types[] = DifferentialTransaction::TYPE_UPDATE; | ||||
| $types[] = DifferentialTransaction::TYPE_ACTION; | $types[] = DifferentialTransaction::TYPE_ACTION; | ||||
| */ | */ | ||||
| return $types; | return $types; | ||||
| } | } | ||||
| Show All 32 Lines | protected function applyCustomInternalTransaction( | ||||
| switch ($xaction->getTransactionType()) { | switch ($xaction->getTransactionType()) { | ||||
| case PhabricatorTransactions::TYPE_VIEW_POLICY: | case PhabricatorTransactions::TYPE_VIEW_POLICY: | ||||
| $object->setViewPolicy($xaction->getNewValue()); | $object->setViewPolicy($xaction->getNewValue()); | ||||
| return; | return; | ||||
| case PhabricatorTransactions::TYPE_EDIT_POLICY: | case PhabricatorTransactions::TYPE_EDIT_POLICY: | ||||
| $object->setEditPolicy($xaction->getNewValue()); | $object->setEditPolicy($xaction->getNewValue()); | ||||
| return; | return; | ||||
| case PhabricatorTransactions::TYPE_SUBSCRIBERS: | case PhabricatorTransactions::TYPE_SUBSCRIBERS: | ||||
| case PhabricatorTransactions::TYPE_EDGE: | |||||
| // TODO: When removing reviewers, we may be able to move the revision | |||||
| // to "Accepted". | |||||
| return; | return; | ||||
| } | } | ||||
| return parent::applyCustomInternalTransaction($object, $xaction); | return parent::applyCustomInternalTransaction($object, $xaction); | ||||
| } | } | ||||
| protected function applyCustomExternalTransaction( | protected function applyCustomExternalTransaction( | ||||
| PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
| PhabricatorApplicationTransaction $xaction) { | PhabricatorApplicationTransaction $xaction) { | ||||
| switch ($xaction->getTransactionType()) { | switch ($xaction->getTransactionType()) { | ||||
| case PhabricatorTransactions::TYPE_VIEW_POLICY: | case PhabricatorTransactions::TYPE_VIEW_POLICY: | ||||
| case PhabricatorTransactions::TYPE_EDIT_POLICY: | case PhabricatorTransactions::TYPE_EDIT_POLICY: | ||||
| return; | return; | ||||
| case PhabricatorTransactions::TYPE_SUBSCRIBERS: | case PhabricatorTransactions::TYPE_SUBSCRIBERS: | ||||
| case PhabricatorTransactions::TYPE_EDGE: | |||||
| return; | return; | ||||
| } | } | ||||
| return parent::applyCustomExternalTransaction($object, $xaction); | return parent::applyCustomExternalTransaction($object, $xaction); | ||||
| } | } | ||||
| protected function validateTransaction( | protected function validateTransaction( | ||||
| PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
| $type, | $type, | ||||
| array $xactions) { | array $xactions) { | ||||
| $errors = parent::validateTransaction($object, $type, $xactions); | $errors = parent::validateTransaction($object, $type, $xactions); | ||||
| switch ($type) { | switch ($type) { | ||||
| } | } | ||||
| return $errors; | return $errors; | ||||
| } | } | ||||
| protected function requireCapabilities( | protected function requireCapabilities( | ||||
| PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
| PhabricatorApplicationTransaction $xaction) { | PhabricatorApplicationTransaction $xaction) { | ||||
| switch ($xaction->getTransactionType()) { | switch ($xaction->getTransactionType()) { | ||||
| } | } | ||||
| return parent::requireCapabilities($object, $xaction); | return parent::requireCapabilities($object, $xaction); | ||||
| Show All 17 Lines | |||||