formatStringConstants($statuses); $orders = array( ManiphestTaskQuery::ORDER_PRIORITY, ManiphestTaskQuery::ORDER_CREATED, ManiphestTaskQuery::ORDER_MODIFIED, ); $order_const = $this->formatStringConstants($orders); return array( 'ids' => 'optional list', 'phids' => 'optional list', 'ownerPHIDs' => 'optional list', 'authorPHIDs' => 'optional list', 'projectPHIDs' => 'optional list', 'ccPHIDs' => 'optional list', 'fullText' => 'optional string', 'status' => 'optional '.$status_const, 'order' => 'optional '.$order_const, 'limit' => 'optional int', 'offset' => 'optional int', ); } public function defineReturnType() { return 'list'; } public function defineErrorTypes() { return array(); } protected function execute(ConduitAPIRequest $request) { $query = id(new ManiphestTaskQuery()) ->setViewer($request->getUser()) ->needProjectPHIDs(true) ->needSubscriberPHIDs(true); $task_ids = $request->getValue('ids'); if ($task_ids) { $query->withIDs($task_ids); } $task_phids = $request->getValue('phids'); if ($task_phids) { $query->withPHIDs($task_phids); } $owners = $request->getValue('ownerPHIDs'); if ($owners) { $query->withOwners($owners); } $authors = $request->getValue('authorPHIDs'); if ($authors) { $query->withAuthors($authors); } $projects = $request->getValue('projectPHIDs'); if ($projects) { $query->withAllProjects($projects); } $ccs = $request->getValue('ccPHIDs'); if ($ccs) { $query->withSubscribers($ccs); } $full_text = $request->getValue('fullText'); if ($full_text) { $query->withFullTextSearch($full_text); } $status = $request->getValue('status'); if ($status) { $query->withStatus($status); } $order = $request->getValue('order'); if ($order) { $query->setOrderBy($order); } $limit = $request->getValue('limit'); if ($limit) { $query->setLimit($limit); } $offset = $request->getValue('offset'); if ($offset) { $query->setOffset($offset); } $results = $query->execute(); return $this->buildTaskInfoDictionaries($results); } }