Differential D8287 Diff 19728 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; | ||||
| } | } | ||||
| protected function getCustomTransactionOldValue( | protected function getCustomTransactionOldValue( | ||||
| PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
| PhabricatorApplicationTransaction $xaction) { | PhabricatorApplicationTransaction $xaction) { | ||||
| switch ($xaction->getTransactionType()) { | switch ($xaction->getTransactionType()) { | ||||
| case PhabricatorTransactions::TYPE_VIEW_POLICY: | |||||
| return $object->getViewPolicy(); | |||||
| case PhabricatorTransactions::TYPE_EDIT_POLICY: | |||||
| return $object->getEditPolicy(); | |||||
| } | } | ||||
| return parent::getCustomTransactionOldValue($object, $xaction); | return parent::getCustomTransactionOldValue($object, $xaction); | ||||
| } | } | ||||
| protected function getCustomTransactionNewValue( | protected function getCustomTransactionNewValue( | ||||
| PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
| PhabricatorApplicationTransaction $xaction) { | PhabricatorApplicationTransaction $xaction) { | ||||
| switch ($xaction->getTransactionType()) { | switch ($xaction->getTransactionType()) { | ||||
| case PhabricatorTransactions::TYPE_VIEW_POLICY: | |||||
| case PhabricatorTransactions::TYPE_EDIT_POLICY: | |||||
| return $xaction->getNewValue(); | |||||
| } | } | ||||
| return parent::getCustomTransactionNewValue($object, $xaction); | return parent::getCustomTransactionNewValue($object, $xaction); | ||||
| } | } | ||||
| protected function applyCustomInternalTransaction( | protected function applyCustomInternalTransaction( | ||||
| PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
| PhabricatorApplicationTransaction $xaction) { | PhabricatorApplicationTransaction $xaction) { | ||||
| switch ($xaction->getTransactionType()) { | switch ($xaction->getTransactionType()) { | ||||
| case PhabricatorTransactions::TYPE_VIEW_POLICY: | |||||
| $object->setViewPolicy($xaction->getNewValue()); | |||||
| return; | |||||
| case PhabricatorTransactions::TYPE_EDIT_POLICY: | |||||
| $object->setEditPolicy($xaction->getNewValue()); | |||||
| 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_EDIT_POLICY: | |||||
| return; | |||||
| } | } | ||||
| return parent::applyCustomExternalTransaction($object, $xaction); | return parent::applyCustomExternalTransaction($object, $xaction); | ||||
| } | } | ||||
| protected function validateTransaction( | protected function validateTransaction( | ||||
| PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
| $type, | $type, | ||||
| Show All 36 Lines | |||||