本文整理汇总了PHP中Reply::getArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Reply::getArray方法的具体用法?PHP Reply::getArray怎么用?PHP Reply::getArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reply
的用法示例。
在下文中一共展示了Reply::getArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$result = array("errCode" => "-1");
if ($auth->canReply()) {
$userID = $auth->getUserID();
$newsID = _get("newsID", 0);
// here, we have to GET params in POST method
$replyID = _get("replyID", 0);
$replyStatement = _post("replyStatement", "");
// deprecated in current design
$replyContent = _post("replyContent", "");
$replyType = _post("replyType", "");
if ($newsID <= 0 || $replyType == "" || $replyType != "like" && $replyContent == "") {
throw new Exception("missing parameters", -1);
}
$replyObj = new Reply();
$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);