Changeset View
Changeset View
Standalone View
Standalone View
src/applications/flag/conduit/FlagQueryConduitAPIMethod.php
<?php | <?php | ||||
final class FlagQueryConduitAPIMethod extends FlagConduitAPIMethod { | final class FlagQueryConduitAPIMethod extends FlagConduitAPIMethod { | ||||
public function getAPIMethodName() { | public function getAPIMethodName() { | ||||
return 'flag.query'; | return 'flag.query'; | ||||
} | } | ||||
public function getMethodDescription() { | public function getMethodDescription() { | ||||
return 'Query flag markers.'; | return 'Query flag markers.'; | ||||
} | } | ||||
public function defineParamTypes() { | protected function defineParamTypes() { | ||||
return array( | return array( | ||||
'ownerPHIDs' => 'optional list<phid>', | 'ownerPHIDs' => 'optional list<phid>', | ||||
'types' => 'optional list<type>', | 'types' => 'optional list<type>', | ||||
'objectPHIDs' => 'optional list<phid>', | 'objectPHIDs' => 'optional list<phid>', | ||||
'offset' => 'optional int', | 'offset' => 'optional int', | ||||
'limit' => 'optional int (default = 100)', | 'limit' => 'optional int (default = 100)', | ||||
); | ); | ||||
} | } | ||||
public function defineReturnType() { | protected function defineReturnType() { | ||||
return 'list<dict>'; | return 'list<dict>'; | ||||
} | } | ||||
public function defineErrorTypes() { | |||||
return array( | |||||
); | |||||
} | |||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
$query = new PhabricatorFlagQuery(); | $query = new PhabricatorFlagQuery(); | ||||
$query->setViewer($request->getUser()); | $query->setViewer($request->getUser()); | ||||
$owner_phids = $request->getValue('ownerPHIDs', array()); | $owner_phids = $request->getValue('ownerPHIDs', array()); | ||||
if ($owner_phids) { | if ($owner_phids) { | ||||
$query->withOwnerPHIDs($owner_phids); | $query->withOwnerPHIDs($owner_phids); | ||||
} | } | ||||
Show All 27 Lines |