当前位置: 首页>>代码示例>>PHP>>正文


PHP SMS::save方法代码示例

本文整理汇总了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;
 }
开发者ID:anthrotech,项目名称:oop_phpunitexample,代码行数:14,代码来源:TestSMS.php

示例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.");
     }
 }
开发者ID:hrshadhin,项目名称:school-management-system,代码行数:20,代码来源:smsController.php

示例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));
 }
开发者ID:erick305,项目名称:testing,代码行数:17,代码来源:SMSController.php

示例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);
开发者ID:anthrotech,项目名称:oop_phpunitexample,代码行数:6,代码来源:index.php


注:本文中的SMS::save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。