Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/method/ConduitAPIMethod.php
Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | public static function getMethodStatusMap() { | ||||
return $map; | return $map; | ||||
} | } | ||||
public function getApplicationName() { | public function getApplicationName() { | ||||
return head(explode('.', $this->getAPIMethodName(), 2)); | return head(explode('.', $this->getAPIMethodName(), 2)); | ||||
} | } | ||||
public static function loadAllConduitMethods() { | public static function loadAllConduitMethods() { | ||||
return self::newClassMapQuery()->execute(); | |||||
} | |||||
private static function newClassMapQuery() { | |||||
return id(new PhutilClassMapQuery()) | return id(new PhutilClassMapQuery()) | ||||
->setAncestorClass(__CLASS__) | ->setAncestorClass(__CLASS__) | ||||
->setUniqueMethod('getAPIMethodName') | ->setUniqueMethod('getAPIMethodName'); | ||||
->execute(); | |||||
} | } | ||||
public static function getConduitMethod($method_name) { | public static function getConduitMethod($method_name) { | ||||
$method_map = self::loadAllConduitMethods(); | return id(new PhabricatorCachedClassMapQuery()) | ||||
return idx($method_map, $method_name); | ->setClassMapQuery(self::newClassMapQuery()) | ||||
->setMapKeyMethod('getAPIMethodName') | |||||
->loadClass($method_name); | |||||
} | } | ||||
public function shouldRequireAuthentication() { | public function shouldRequireAuthentication() { | ||||
return true; | return true; | ||||
} | } | ||||
public function shouldAllowPublic() { | public function shouldAllowPublic() { | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 229 Lines • Show Last 20 Lines |