Differential D12380 Diff 29771 src/applications/maniphest/conduit/ManiphestQueryConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/conduit/ManiphestQueryConduitAPIMethod.php
<?php | <?php | ||||
final class ManiphestQueryConduitAPIMethod extends ManiphestConduitAPIMethod { | final class ManiphestQueryConduitAPIMethod extends ManiphestConduitAPIMethod { | ||||
public function getAPIMethodName() { | public function getAPIMethodName() { | ||||
return 'maniphest.query'; | return 'maniphest.query'; | ||||
} | } | ||||
public function getMethodDescription() { | public function getMethodDescription() { | ||||
return 'Execute complex searches for Maniphest tasks.'; | return 'Execute complex searches for Maniphest tasks.'; | ||||
} | } | ||||
public function defineParamTypes() { | protected function defineParamTypes() { | ||||
$statuses = array( | $statuses = array( | ||||
ManiphestTaskQuery::STATUS_ANY, | ManiphestTaskQuery::STATUS_ANY, | ||||
ManiphestTaskQuery::STATUS_OPEN, | ManiphestTaskQuery::STATUS_OPEN, | ||||
ManiphestTaskQuery::STATUS_CLOSED, | ManiphestTaskQuery::STATUS_CLOSED, | ||||
ManiphestTaskQuery::STATUS_RESOLVED, | ManiphestTaskQuery::STATUS_RESOLVED, | ||||
ManiphestTaskQuery::STATUS_WONTFIX, | ManiphestTaskQuery::STATUS_WONTFIX, | ||||
ManiphestTaskQuery::STATUS_INVALID, | ManiphestTaskQuery::STATUS_INVALID, | ||||
ManiphestTaskQuery::STATUS_SPITE, | ManiphestTaskQuery::STATUS_SPITE, | ||||
Show All 20 Lines | return array( | ||||
'status' => 'optional '.$status_const, | 'status' => 'optional '.$status_const, | ||||
'order' => 'optional '.$order_const, | 'order' => 'optional '.$order_const, | ||||
'limit' => 'optional int', | 'limit' => 'optional int', | ||||
'offset' => 'optional int', | 'offset' => 'optional int', | ||||
); | ); | ||||
} | } | ||||
public function defineReturnType() { | protected function defineReturnType() { | ||||
return 'list'; | return 'list'; | ||||
} | } | ||||
public function defineErrorTypes() { | |||||
return array(); | |||||
} | |||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
$query = id(new ManiphestTaskQuery()) | $query = id(new ManiphestTaskQuery()) | ||||
->setViewer($request->getUser()) | ->setViewer($request->getUser()) | ||||
->needProjectPHIDs(true) | ->needProjectPHIDs(true) | ||||
->needSubscriberPHIDs(true); | ->needSubscriberPHIDs(true); | ||||
$task_ids = $request->getValue('ids'); | $task_ids = $request->getValue('ids'); | ||||
if ($task_ids) { | if ($task_ids) { | ||||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |