[enh] adding the possibility of - in calls: list-mails will be called as listMails
This commit is contained in:
parent
5a6d17b347
commit
398813ab71
|
@ -143,6 +143,11 @@ class Alternc_Api_Service {
|
||||||
$object = new $className($this);
|
$object = new $className($this);
|
||||||
|
|
||||||
$action = $request->action;
|
$action = $request->action;
|
||||||
|
|
||||||
|
if (strpos($action,"-")!==false) {
|
||||||
|
// replace - by an uppercase letter:
|
||||||
|
$action = lcfirst(str_replace(" ", "", implode("", array_map("ucfirst", explode("-", $action)))));
|
||||||
|
}
|
||||||
if (!method_exists($object, $action))
|
if (!method_exists($object, $action))
|
||||||
return new Alternc_Api_Response(array("code" => self::ERR_ACTION_NOT_FOUND, "message" => "Action not found for this object in this AlternC's instance"));
|
return new Alternc_Api_Response(array("code" => self::ERR_ACTION_NOT_FOUND, "message" => "Action not found for this object in this AlternC's instance"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue