本文整理汇总了PHP中Reply::getJson方法的典型用法代码示例。如果您正苦于以下问题:PHP Reply::getJson方法的具体用法?PHP Reply::getJson怎么用?PHP Reply::getJson使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reply
的用法示例。
在下文中一共展示了Reply::getJson方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Exception
$replyObj->saveReply($replyID, $newsID, $userID, $replyStatement, $replyContent, $replyType);
$result = $replyObj->getArray();
}
echo json_encode($result);
} else {
if (is_del()) {
$newsID = _get("newsID", 0);
$replyID = _get("replyID", 0);
$subReplyID = _get("subReplyID", 0);
if ($replyID == 0) {
throw new Exception("no such replyID", -1);
}
$auth = Auth::getInstance();
$replyObj = new Reply($replyID);
$userID = $replyObj->getReplyUserID($subReplyID);
if ($userID != $auth->getUserID()) {
throw new Exception("unauthorized deletion", -1);
}
$replyObj->removeReply($subReplyID);
if ($subReplyID > 0) {
echo $replyObj->getJson();
} else {
echo json_encode(array("errCode" => 0, "errMessage" => "deletion succeeded", "replyID" => $replyID));
}
}
}
}
} catch (Exception $e) {
$result = array("errCode" => $e->getCode(), "errMessage" => $e->getMessage());
echo json_encode($result);
}