本文整理汇总了PHP中message::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP message::insert方法的具体用法?PHP message::insert怎么用?PHP message::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类message
的用法示例。
在下文中一共展示了message::insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetInvalidMessageByMessageText
/**
*Test Getting Invalid Message by Message Text; messageText
*/
public function testGetInvalidMessageByMessageText()
{
//create a new message
$newMessage = new message(null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);
$newMessage->insert($this->getPDO());
//grab the data from guzzle
$response = $this->guzzle->get('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/' . $newMessage - getMessage());
$this->assertSame($response->getStatusCode(), 200);
$body = $response->getBody();
$alertLevel = json_decode($body);
$this->assertSame(200, $alertLevel->status);
}
示例2: stripslashes
/* completing information about selected recipients */
$sel_person += sel_items('sel_persons');
$sel_group += sel_items('sel_groups');
if ($action == 'write' || $action == 'preview' || $action == 'send') {
if (count($sel_person) + count($sel_group) == 0) {
$found = list_person_group();
$sel_person = $found['person'];
$sel_group = $found['group'];
}
if (isset($_POST['text'])) {
$text = stripslashes($_POST['text']);
}
$msg = new message();
$msg->create($text, $sel_person, $sel_group);
if ($action == 'send') {
$msg->insert();
$_SESSION['notice'] = 'message sent';
redirect('./');
}
if ($action == 'write' || $action == 'preview') {
$message = '';
$msg->format();
$message = $msg->output;
$v['message'] = $message;
$v['sel_person'] = $sel_person;
$v['sel_group'] = $sel_group;
$v['text'] = $text;
$content = new tmpl('new.html', $v);
}
}
if ($action == 'start' || $action == 'search') {