Differential D18341 Diff 44160 src/applications/differential/xaction/DifferentialRevisionRequestReviewTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/xaction/DifferentialRevisionRequestReviewTransaction.php
| Show All 31 Lines | final class DifferentialRevisionRequestReviewTransaction | ||||
| } | } | ||||
| public function applyInternalEffects($object, $value) { | public function applyInternalEffects($object, $value) { | ||||
| $status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW; | $status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW; | ||||
| $object->setStatus($status_review); | $object->setStatus($status_review); | ||||
| } | } | ||||
| protected function validateAction($object, PhabricatorUser $viewer) { | protected function validateAction($object, PhabricatorUser $viewer) { | ||||
| $status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW; | if ($object->isNeedsReview()) { | ||||
| if ($object->getStatus() == $status_review) { | |||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'You can not request review of this revision because this '. | 'You can not request review of this revision because this '. | ||||
| 'revision is already under review and the action would have '. | 'revision is already under review and the action would have '. | ||||
| 'no effect.')); | 'no effect.')); | ||||
| } | } | ||||
| if ($object->isClosed()) { | if ($object->isClosed()) { | ||||
| Show All 29 Lines | |||||