Differential D10289 Diff 32177 src/applications/repository/conduit/RepositoryQueryConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/conduit/RepositoryQueryConduitAPIMethod.php
Show All 25 Lines | final class RepositoryQueryConduitAPIMethod | ||||
protected function defineParamTypes() { | protected function defineParamTypes() { | ||||
return array( | return array( | ||||
'ids' => 'optional list<int>', | 'ids' => 'optional list<int>', | ||||
'phids' => 'optional list<phid>', | 'phids' => 'optional list<phid>', | ||||
'callsigns' => 'optional list<string>', | 'callsigns' => 'optional list<string>', | ||||
'vcsTypes' => 'optional list<string>', | 'vcsTypes' => 'optional list<string>', | ||||
'remoteURIs' => 'optional list<string>', | 'remoteURIs' => 'optional list<string>', | ||||
'uuids' => 'optional list<string>', | 'uuids' => 'optional list<string>', | ||||
'projectPHIDs' => 'optional list<phid>', | |||||
); | ); | ||||
} | } | ||||
protected function defineReturnType() { | protected function defineReturnType() { | ||||
return 'list<dict>'; | return 'list<dict>'; | ||||
} | } | ||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
Show All 24 Lines | if ($remote_uris) { | ||||
$query->withRemoteURIs($remote_uris); | $query->withRemoteURIs($remote_uris); | ||||
} | } | ||||
$uuids = $request->getValue('uuids', array()); | $uuids = $request->getValue('uuids', array()); | ||||
if ($uuids) { | if ($uuids) { | ||||
$query->withUUIDs($uuids); | $query->withUUIDs($uuids); | ||||
} | } | ||||
$projects = $request->getValue('projectPHIDs', array()); | |||||
if ($projects) { | |||||
$query->withAnyProjects($projects); | |||||
} | |||||
$query->needProjectPHIDs(true); | |||||
$pager = $this->newPager($request); | $pager = $this->newPager($request); | ||||
$repositories = $query->executeWithCursorPager($pager); | $repositories = $query->executeWithCursorPager($pager); | ||||
$results = array(); | $results = array(); | ||||
foreach ($repositories as $repository) { | foreach ($repositories as $repository) { | ||||
$results[] = $repository->toDictionary(); | $results[] = $repository->toDictionary(); | ||||
} | } | ||||
return $results; | return $results; | ||||
} | } | ||||
} | } |