本文整理汇总了PHP中Update::getMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Update::getMessage方法的具体用法?PHP Update::getMessage怎么用?PHP Update::getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Update
的用法示例。
在下文中一共展示了Update::getMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$log = new Logging();
// $parenClass = new ParentClass();
// set path and name of log file (optional)
$log->lfile('log.txt');
$json = file_get_contents('php://input');
$log->lwrite("post: " . $json);
$update = new Update($json);
$message = $update->getMessage();
$chat = $message->getChat();
$chat_id = $chat->getId();
$text = $message->getText();
$client = new Client();
$client->sendMessage($chat_id, $text, null, null, null);
$client->sendLocation($chat_id, 53.480759, -2.242631, null, null);
$client->sendPhoto($chat_id, 'pic.jpg', 'sweety', null, null);
$log->lclose();
}
示例2: Update
// get acceptedID
$accepted = Accepted::getByUserID(Session::getUserID(), $task->getID());
// update status
$accepted->setStatus($status);
$accepted->save();
// create the update
$update = new Update(array('creator_id' => Session::getUserID(), 'accepted_id' => $accepted->getID(), 'project_id' => $project->getID(), 'title' => $title, 'message' => $message));
$update->save();
// save uploaded files to database
foreach ($_POST['file'] as $stored => $orig) {
$stored = Filter::text($stored);
$orig = Filter::text($orig);
Upload::saveToDatabase($orig, $stored, Upload::TYPE_UPDATE, $update->getID(), $project->getID());
}
// log it
$logEvent = new Event(array('event_type_id' => 'create_update', 'user_1_id' => Session::getUserID(), 'project_id' => $project->getID(), 'item_1_id' => $update->getID(), 'item_2_id' => $accepted->getID(), 'item_3_id' => $task->getID(), 'data_1' => $update->getTitle(), 'data_2' => $update->getMessage()));
$logEvent->save();
// we're done here
Session::setMessage('You created a new update for this task.');
$json = array('success' => '1', 'successUrl' => Url::update($update->getID()));
echo json_encode($json);
} elseif ($action == 'edit-update') {
// validate update
$updateID = Filter::numeric($_GET['u']);
$update = Update::load($updateID);
if ($update == null) {
header('Location: ' . Url::error());
exit;
}
// get update content
$title = Filter::text($_POST['txtTitle']);