3 final class DifferentialCloseConduitAPIMethod
4 extends DifferentialConduitAPIMethod
{
6 public function getAPIMethodName() {
7 return 'differential.close';
10 public function getMethodDescription() {
11 return pht('Close a Differential revision.');
14 public function getMethodStatus() {
15 return self
::METHOD_STATUS_FROZEN
;
18 public function getMethodStatusDescription() {
20 'This method is frozen and will eventually be deprecated. New code '.
21 'should use "differential.revision.edit" instead.');
24 protected function defineParamTypes() {
26 'revisionID' => 'required int',
30 protected function defineReturnType() {
34 protected function defineErrorTypes() {
36 'ERR_NOT_FOUND' => pht('Revision was not found.'),
40 protected function execute(ConduitAPIRequest
$request) {
41 $viewer = $request->getUser();
42 $id = $request->getValue('revisionID');
44 $revision = id(new DifferentialRevisionQuery())
50 throw new ConduitException('ERR_NOT_FOUND');
54 $xactions[] = id(new DifferentialTransaction())
56 DifferentialRevisionCloseTransaction
::TRANSACTIONTYPE
)
59 $content_source = $request->newContentSource();
61 $editor = id(new DifferentialTransactionEditor())
63 ->setContentSource($request->newContentSource())
64 ->setContinueOnMissingFields(true)
65 ->setContinueOnNoEffect(true);
67 $editor->applyTransactions($revision, $xactions);