Differential D12380 Diff 29771 src/applications/harbormaster/conduit/HarbormasterQueryBuildablesConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/conduit/HarbormasterQueryBuildablesConduitAPIMethod.php
<?php | <?php | ||||
final class HarbormasterQueryBuildablesConduitAPIMethod | final class HarbormasterQueryBuildablesConduitAPIMethod | ||||
extends HarbormasterConduitAPIMethod { | extends HarbormasterConduitAPIMethod { | ||||
public function getAPIMethodName() { | public function getAPIMethodName() { | ||||
return 'harbormaster.querybuildables'; | return 'harbormaster.querybuildables'; | ||||
} | } | ||||
public function getMethodDescription() { | public function getMethodDescription() { | ||||
return pht('Query Harbormaster buildables.'); | return pht('Query Harbormaster buildables.'); | ||||
} | } | ||||
public function defineParamTypes() { | protected function defineParamTypes() { | ||||
return array( | return array( | ||||
'ids' => 'optional list<id>', | 'ids' => 'optional list<id>', | ||||
'phids' => 'optional list<phid>', | 'phids' => 'optional list<phid>', | ||||
'buildablePHIDs' => 'optional list<phid>', | 'buildablePHIDs' => 'optional list<phid>', | ||||
'containerPHIDs' => 'optional list<phid>', | 'containerPHIDs' => 'optional list<phid>', | ||||
'manualBuildables' => 'optional bool', | 'manualBuildables' => 'optional bool', | ||||
) + self::getPagerParamTypes(); | ) + self::getPagerParamTypes(); | ||||
} | } | ||||
public function defineReturnType() { | protected function defineReturnType() { | ||||
return 'wild'; | return 'wild'; | ||||
} | } | ||||
public function defineErrorTypes() { | |||||
return array(); | |||||
} | |||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
$viewer = $request->getUser(); | $viewer = $request->getUser(); | ||||
$query = id(new HarbormasterBuildableQuery()) | $query = id(new HarbormasterBuildableQuery()) | ||||
->setViewer($viewer); | ->setViewer($viewer); | ||||
$ids = $request->getValue('ids'); | $ids = $request->getValue('ids'); | ||||
if ($ids !== null) { | if ($ids !== null) { | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |