From 398813ab719d46f19749012962e8ecfd798c4d45 Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Fri, 27 Feb 2015 16:23:39 +0100 Subject: [PATCH] =?UTF-8?q?[enh]=C2=A0adding=20the=20possibility=20of=20-?= =?UTF-8?q?=20in=20calls:=20list-mails=20will=20be=20called=20as=20listMai?= =?UTF-8?q?ls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Alternc/Api/Service.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Alternc/Api/Service.php b/lib/Alternc/Api/Service.php index dfaea26a..52fa3b44 100644 --- a/lib/Alternc/Api/Service.php +++ b/lib/Alternc/Api/Service.php @@ -143,6 +143,11 @@ class Alternc_Api_Service { $object = new $className($this); $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)) return new Alternc_Api_Response(array("code" => self::ERR_ACTION_NOT_FOUND, "message" => "Action not found for this object in this AlternC's instance"));