Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/method/ConduitAPI_conduit_query_Method.php
| <?php | <?php | ||||
| /** | /** | ||||
| * @group conduit | * @group conduit | ||||
| */ | */ | ||||
| final class ConduitAPI_conduit_query_Method extends ConduitAPIMethod { | final class ConduitAPI_conduit_query_Method extends ConduitAPIMethod { | ||||
| public function getMethodDescription() { | public function getMethodDescription() { | ||||
| return "Returns the parameters of the Conduit methods."; | return 'Returns the parameters of the Conduit methods.'; | ||||
| } | } | ||||
| public function defineParamTypes() { | public function defineParamTypes() { | ||||
| return array(); | return array(); | ||||
| } | } | ||||
| public function defineReturnType() { | public function defineReturnType() { | ||||
| return 'dict<dict>'; | return 'dict<dict>'; | ||||
| } | } | ||||
| public function defineErrorTypes() { | public function defineErrorTypes() { | ||||
| return array(); | return array(); | ||||
| } | } | ||||
| protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
| $classes = id(new PhutilSymbolLoader()) | $classes = id(new PhutilSymbolLoader()) | ||||
| ->setAncestorClass('ConduitAPIMethod') | ->setAncestorClass('ConduitAPIMethod') | ||||
| ->setType('class') | ->setType('class') | ||||
| ->setConcreteOnly(true) | ->setConcreteOnly(true) | ||||
| ->selectSymbolsWithoutLoading(); | ->selectSymbolsWithoutLoading(); | ||||
| $names_to_params = array(); | $names_to_params = array(); | ||||
| foreach ($classes as $class) { | foreach ($classes as $class) { | ||||
| $method_name = $class["name"]; | $method_name = $class['name']; | ||||
| $obj = newv($method_name, array()); | $obj = newv($method_name, array()); | ||||
| $names_to_params[$this->getAPIMethodNameFromClassName($method_name)] = | $names_to_params[$this->getAPIMethodNameFromClassName($method_name)] = | ||||
| array("params" => $obj->defineParamTypes()); | array('params' => $obj->defineParamTypes()); | ||||
| } | } | ||||
| return $names_to_params; | return $names_to_params; | ||||
| } | } | ||||
| } | } | ||||