/** * Handles the current node in the xml reading loop. * Warning : Don't forget to call parent method... * @param DOMNode $node The current xml node * @param RequestResultBase $resultObj The object which will be returned to the end-user * @return boolean True if the node was handled */ protected function handleXmlReaderCurrentNode(DOMNode $node, $resultObj) { switch ($node->nodeName) { case "request": $resultObj->setSessionId($node->textContent); return true; case "status": $resultObj->setStatus((int) $node->textContent); return true; case "timems": $resultObj->setTimeInMs(floatval($node->textContent)); return true; } return false; }
/** * Checks the result code of a query. * @param RequestResultBase $result the result object to test * @throws PrediggoException in case the result contains an error. */ private static function checkStatus(RequestResultBase $result) { $result->setStatusMessage(self::getStatusMessageForStatusCode($result->getStatus())); //error returned? if ($result->getStatus() < 0) { throw new PrediggoException($result->getStatusMessage() . " (" . $result->getStatus() . ")"); } }