Differential D18412 Diff 44256 src/applications/differential/conduit/DifferentialCloseConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/conduit/DifferentialCloseConduitAPIMethod.php
| Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | $revision = id(new DifferentialRevisionQuery()) | ||||
| ->needReviewers(true) | ->needReviewers(true) | ||||
| ->executeOne(); | ->executeOne(); | ||||
| if (!$revision) { | if (!$revision) { | ||||
| throw new ConduitException('ERR_NOT_FOUND'); | throw new ConduitException('ERR_NOT_FOUND'); | ||||
| } | } | ||||
| $xactions = array(); | $xactions = array(); | ||||
| $xactions[] = id(new DifferentialTransaction()) | $xactions[] = id(new DifferentialTransaction()) | ||||
| ->setTransactionType(DifferentialTransaction::TYPE_ACTION) | ->setTransactionType( | ||||
| ->setNewValue(DifferentialAction::ACTION_CLOSE); | DifferentialRevisionCloseTransaction::TRANSACTIONTYPE) | ||||
| ->setNewValue(true); | |||||
| $content_source = $request->newContentSource(); | $content_source = $request->newContentSource(); | ||||
| $editor = id(new DifferentialTransactionEditor()) | $editor = id(new DifferentialTransactionEditor()) | ||||
| ->setActor($viewer) | ->setActor($viewer) | ||||
| ->setContentSource($request->newContentSource()) | ->setContentSource($request->newContentSource()) | ||||
| ->setContinueOnMissingFields(true) | ->setContinueOnMissingFields(true) | ||||
| ->setContinueOnNoEffect(true); | ->setContinueOnNoEffect(true); | ||||
| $editor->applyTransactions($revision, $xactions); | $editor->applyTransactions($revision, $xactions); | ||||
| return; | return; | ||||
| } | } | ||||
| } | } | ||||