本文整理汇总了PHP中Conversation::get_messages方法的典型用法代码示例。如果您正苦于以下问题:PHP Conversation::get_messages方法的具体用法?PHP Conversation::get_messages怎么用?PHP Conversation::get_messages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conversation
的用法示例。
在下文中一共展示了Conversation::get_messages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
$data =json_decode($request);
$date_id = $data->date_id;
// $date_id = 13;
$user = User::get_current_user();
try {
if (is_numeric($date_id)) {
$mysqli = Database::connection();
$sql = "SELECT conversation_id, conversation_name, closed, date_started, date_recent_activity, header, date_id, joinable FROM `conversations` WHERE date_id ='$date_id'";
$result = $mysqli->query($sql)
or die ($mysqli->error);
if ($result->num_rows == 1) {
$conversation_id = mysqli_fetch_row($result)[0];
$conversation = new Conversation(array(
'conversation_id' => $conversation_id)
);
$conversation->get_messages();
$is_admin = $conversation->user_admin($user);
$conversation->current_user_admin = $is_admin;
http_response_code(200);
echo json_encode($conversation, JSON_PRETTY_PRINT);
}
else {
throw new OutOfRangeException('OutOfRangeException occured on request, conversation does not exist');
}
}
else {
throw new UnexpectedValueException('UnexpectedValueException occured on request');
}
}
catch (Exception $e) {
http_response_code(400);