Differential D12380 Diff 29771 src/applications/maniphest/conduit/ManiphestUpdateConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/conduit/ManiphestUpdateConduitAPIMethod.php
<?php | <?php | ||||
final class ManiphestUpdateConduitAPIMethod extends ManiphestConduitAPIMethod { | final class ManiphestUpdateConduitAPIMethod extends ManiphestConduitAPIMethod { | ||||
public function getAPIMethodName() { | public function getAPIMethodName() { | ||||
return 'maniphest.update'; | return 'maniphest.update'; | ||||
} | } | ||||
public function getMethodDescription() { | public function getMethodDescription() { | ||||
return 'Update an existing Maniphest task.'; | return 'Update an existing Maniphest task.'; | ||||
} | } | ||||
public function defineErrorTypes() { | protected function defineErrorTypes() { | ||||
return array( | return array( | ||||
'ERR-BAD-TASK' => 'No such maniphest task exists.', | 'ERR-BAD-TASK' => 'No such maniphest task exists.', | ||||
'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.', | 'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.', | ||||
'ERR-NO-EFFECT' => 'Update has no effect.', | 'ERR-NO-EFFECT' => 'Update has no effect.', | ||||
); | ); | ||||
} | } | ||||
public function defineParamTypes() { | protected function defineParamTypes() { | ||||
return $this->getTaskFields($is_new = false); | return $this->getTaskFields($is_new = false); | ||||
} | } | ||||
public function defineReturnType() { | protected function defineReturnType() { | ||||
return 'nonempty dict'; | return 'nonempty dict'; | ||||
} | } | ||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
$id = $request->getValue('id'); | $id = $request->getValue('id'); | ||||
$phid = $request->getValue('phid'); | $phid = $request->getValue('phid'); | ||||
if (($id && $phid) || (!$id && !$phid)) { | if (($id && $phid) || (!$id && !$phid)) { | ||||
Show All 32 Lines |