本文整理汇总了PHP中SMS::save方法的典型用法代码示例。如果您正苦于以下问题:PHP SMS::save方法的具体用法?PHP SMS::save怎么用?PHP SMS::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMS
的用法示例。
在下文中一共展示了SMS::save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSave
/**
* Test Save Function
*/
public function testSave()
{
$sms = new SMS();
$token = $sms->get_auth_token();
$date = date('Y-m-d H:i:s');
$sms->save('00001111', '1', '2', 'testing', $date, $token);
$resultingTable = $this->getConnection()->createQueryTable("mo", "SELECT msisdn,operatorid,shortcodeid,text FROM mo WHERE msisdn = '00001111' and text = 'testing' LIMIT 1");
$expectedTable = $this->createXmlDataSet("expected_data.xml")->getTable("mo");
$this->assertTablesEqual($expectedTable, $resultingTable);
echo 'Test 2: (Saving to Database): {"status": "ok"}' . PHP_EOL;
}
示例2: create
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
$rules = ['type' => 'required', 'sender' => 'required|max:100', 'message' => 'required'];
$validator = \Validator::make(Input::all(), $rules);
if ($validator->fails()) {
return Redirect::to('/sms')->withErrors($validator);
} else {
$sms = new SMS();
$sms->type = Input::get('type');
$sms->sender = Input::get('sender');
$sms->message = Input::get('message');
$sms->save();
return Redirect::to('/sms')->with("success", "SMS Format Created Succesfully.");
}
}
示例3: actionCreate
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate()
{
$model = new SMS();
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if (isset($_POST['SMS'])) {
$model->attributes = $_POST['SMS'];
if ($model->save()) {
$this->redirect(array('view', 'id' => $model->id));
}
}
$this->render('create', array('model' => $model));
}
示例4: SMS
<?php
require_once 'functions.php';
$sms = new SMS();
$token = $sms->get_auth_token();
$sms->save($_REQUEST['msisdn'], $_REQUEST['operatorid'], $_REQUEST['shortcodeid'], $_REQUEST['text'], null, $token);