/** * This function executes the eMobilePlatform operation. Simply supply * the group and method name. Most actions will require an additional * parameter object. See the documentation for more information. * * @param string $groupName The family of functions to access. * @param string $methodName The specific operation to preform. * @param Param $params An optional param object. * @return Result A result object. * @throws \InvalidArgumentException */ public function executeAction($groupName, $methodName, Param $params = null) { if (!is_string($groupName) || !is_string($methodName) || !$params instanceof Param && $params !== null) { throw new \InvalidArgumentException('Invalid Arguments Supplied'); } $xml = $this->generateXML($groupName, $methodName, $params->getArray()); if ($xml === null) { return new Result(Result::ERROR_LEVEL_FATAL, 'XML content could not be generated!'); } $responseXML = $this->sendXML($xml); if ($responseXML === null) { return new Result(Result::ERROR_LEVEL_FATAL, 'A cURL error occured'); } $result = $this->parseResult($responseXML); return $result; }