Changeset View
Changeset View
Standalone View
Standalone View
src/applications/flag/conduit/FlagEditConduitAPIMethod.php
<?php | <?php | ||||
final class FlagEditConduitAPIMethod extends FlagConduitAPIMethod { | final class FlagEditConduitAPIMethod extends FlagConduitAPIMethod { | ||||
public function getAPIMethodName() { | public function getAPIMethodName() { | ||||
return 'flag.edit'; | return 'flag.edit'; | ||||
} | } | ||||
public function getMethodDescription() { | public function getMethodDescription() { | ||||
return 'Create or modify a flag.'; | return 'Create or modify a flag.'; | ||||
} | } | ||||
public function defineParamTypes() { | protected function defineParamTypes() { | ||||
return array( | return array( | ||||
'objectPHID' => 'required phid', | 'objectPHID' => 'required phid', | ||||
'color' => 'optional int', | 'color' => 'optional int', | ||||
'note' => 'optional string', | 'note' => 'optional string', | ||||
); | ); | ||||
} | } | ||||
public function defineReturnType() { | protected function defineReturnType() { | ||||
return 'dict'; | return 'dict'; | ||||
} | } | ||||
public function defineErrorTypes() { | |||||
return array( | |||||
); | |||||
} | |||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
$user = $request->getUser()->getPHID(); | $user = $request->getUser()->getPHID(); | ||||
$phid = $request->getValue('objectPHID'); | $phid = $request->getValue('objectPHID'); | ||||
$new = false; | $new = false; | ||||
$flag = id(new PhabricatorFlag())->loadOneWhere( | $flag = id(new PhabricatorFlag())->loadOneWhere( | ||||
'objectPHID = %s AND ownerPHID = %s', | 'objectPHID = %s AND ownerPHID = %s', | ||||
$phid, | $phid, | ||||
Show All 28 Lines |