當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Phone類代碼示例

本文整理匯總了PHP中Phone的典型用法代碼示例。如果您正苦於以下問題:PHP Phone類的具體用法?PHP Phone怎麽用?PHP Phone使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Phone類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: sendOrders

 public function sendOrders()
 {
     set_time_limit(60000);
     try {
         $user = User::find(5);
         if ($user->u_priase_count == 0) {
             throw new Exception("已經執行過了", 30001);
         } else {
             $user->u_priase_count = 0;
             $user->save();
         }
         $str_text = '恭喜“雙11不怕剁手”眾籌活動已成功,您被眾籌發起者選中,請於12日18時前憑此信息到零棟鋪子領取眾籌回報。4006680550';
         $str_push = '恭喜“雙11不怕剁手”眾籌活動已成功,您被眾籌發起者選中,請於12日18時前憑此信息到零棟鋪子領取眾籌回報。4006680550';
         $orders = Order::selectRaw('right(`t_orders`.`o_number`, 4) AS seed, `t_orders`.*')->join('carts', function ($q) {
             $q->on('orders.o_id', '=', 'carts.o_id');
         })->where('carts.c_type', '=', 2)->where('carts.p_id', '=', 4)->orderBy('seed', 'DESC')->limit(111)->get();
         foreach ($orders as $key => $order) {
             if (empty($order)) {
                 continue;
             }
             $phones = $order->o_shipping_phone;
             $pushObj = new PushMessage($order->u_id);
             $pushObj->pushMessage($str_push);
             echo 'pushed to ' . $order->u_id . ' </br>';
             $phoneObj = new Phone($order->o_shipping_phone);
             $phoneObj->sendText($str_text);
             echo 'texted to ' . $order->o_shipping_phone . ' </br>';
         }
         File::put('/var/www/qingnianchuangke/phones', implode(',', $phones));
         $re = Tools::reTrue('發送中獎信息成功');
     } catch (Exception $e) {
         $re = Tools::reFalse($e->getCode(), '發送中獎信息失敗:' . $e->getMessage());
     }
     return Response::json($re);
 }
開發者ID:qnck,項目名稱:qingnianchuangke,代碼行數:35,代碼來源:EmergencyController.php

示例2: actionAdmin

 public function actionAdmin()
 {
     $model = new Phone('search');
     $model->unsetAttributes();
     if (isset($_GET['Phone'])) {
         $model->setAttributes($_GET['Phone']);
     }
     $this->render('admin', array('model' => $model));
 }
開發者ID:hanihh,項目名稱:vvs_v2,代碼行數:9,代碼來源:PhoneController.php

示例3: xmlSerializeMustAppendFormattedPhoneData

 /**
  * @test
  */
 public function xmlSerializeMustAppendFormattedPhoneData()
 {
     $this->markTestSkipped();
     $xml = simplexml_load_string('<?xml version="1.0" encoding="UTF-8"?><test />');
     $phone = new Phone(479, 1234567890);
     $phone->xmlSerialize($xml);
     $this->assertEquals(47, (string) $xml->phone->areaCode);
     $this->assertEquals(123456789, (string) $xml->phone->number);
 }
開發者ID:leonardorifeli,項目名稱:pagseguro,代碼行數:12,代碼來源:PhoneTest.php

示例4: createFromXML

 /**
  * Convert the raw XML into an object
  *
  * @param \SimpleXMLElement $xml
  * @return Phone
  */
 public static function createFromXML(\SimpleXMLElement $xml)
 {
     $phone = new Phone();
     $attributes = $xml->attributes();
     if (isset($attributes['type'])) {
         $phone->setType((string) $attributes['type']);
     }
     $phone->setValue((string) $xml);
     return $phone;
 }
開發者ID:tijsverkoyen,項目名稱:uitdatabank,代碼行數:16,代碼來源:Phone.php

示例5: testPhone

 public function testPhone()
 {
     $phone = new Phone('+00.000000000');
     $this->assertEquals('+00.000000000', $phone->getPhone());
     $phone = new Phone('+0.000000');
     $this->assertEquals('+00.000000000', $phone->getPhone());
     // test space stripping
     $phone = new Phone('+00.0 0000 0000');
     $this->assertEquals('+00.000000000', $phone->getPhone());
 }
開發者ID:paulferrett,項目名稱:synergy-wholesale,代碼行數:10,代碼來源:PhoneTest.php

示例6: getVCode

 /**
  * generate and send a verification code
  * @return response json output
  */
 public function getVCode()
 {
     $mobile = Input::get('mobile');
     try {
         $phone = new Phone($mobile);
         $code = $phone->sendVCode();
         $data = ['vcode' => $code];
         $re = ['data' => $data, 'result' => 2000, 'info' => '驗證碼已經發送'];
     } catch (Exception $e) {
         $re = ['data' => [], 'result' => 2001, 'info' => $e->getMessage()];
     }
     return Response::json($re);
 }
開發者ID:qnck,項目名稱:qingnianchuangke,代碼行數:17,代碼來源:VerificationController.php

示例7: data_parse

 public function data_parse()
 {
     if (!empty($this->json_response['error'])) {
         $this->error = $this->json_response['error']['message'];
     } else {
         $location_array = array();
         while (list(, $results_val) = each($this->json_response['results'])) {
             if (!empty($results_val)) {
                 // get phone data and people ids from belongs to
                 $phone = new Phone($this->json_response['dictionary'][$results_val]);
                 $this->phone = $phone->data();
                 $belongs_to = $phone->belongs_to;
                 $person_array = array();
                 $temp_location_array = array();
                 // get people data and store it in person_array
                 // store best location id of belongs to people in temp_location_array
                 if (!empty($belongs_to)) {
                     while (list(, $belongs_val) = each($belongs_to)) {
                         $person = new Person($this->json_response['dictionary'][$belongs_val]);
                         array_push($person_array, $person->data());
                         array_push($temp_location_array, $person->best_location());
                     }
                     $temp_location_array = array_filter($temp_location_array);
                     // get location data by location_keys array.
                     if (!empty($temp_location_array)) {
                         $location_keys = array_unique($temp_location_array);
                         while (list(, $location_key) = each($location_keys)) {
                             $location = new Location($this->json_response['dictionary'][$location_key]);
                             array_push($location_array, $location->data());
                         }
                     } else {
                         // get location data from phone best location id. if belongs to location id is blank.
                         if ($phone->best_location) {
                             $location = new Location($this->json_response['dictionary'][$phone->best_location]);
                             array_push($location_array, $location->data());
                         }
                     }
                 } else {
                     if ($phone->best_location) {
                         $location = new Location($this->json_response['dictionary'][$phone->best_location]);
                         array_push($location_array, $location->data());
                     }
                 }
                 $this->people = $person_array;
                 $this->location = $location_array;
             }
         }
     }
 }
開發者ID:scriptmediala,項目名稱:Whitepages-Pro-API-Examples,代碼行數:49,代碼來源:result.php

示例8: GetInstance

 /**
  * @return Phone
  */
 public static function GetInstance()
 {
     if (self::$Instance === null) {
         self::$Instance = new Phone();
     }
     return self::$Instance;
 }
開發者ID:rchicoria,項目名稱:epp-drs,代碼行數:10,代碼來源:class.Phone.php

示例9: delete

 public function delete()
 {
     if (!Phone::delete($_POST['id'])) {
         $_SESSION['ERROR'] = "Unable to delete phone number.";
     }
     // THIS IS STUPID
     header("LOCATION: " . $_POST['path']);
 }
開發者ID:MatthewAry,項目名稱:php-cs313,代碼行數:8,代碼來源:phone_controller.php

示例10: handleCreate

 public function handleCreate()
 {
     DB::transaction(function () {
         $input = Input::all();
         $person = new Person();
         $localizationController = new LocalizationController();
         $person->names = $input['names'];
         $person->last_name = $input['last_name'];
         $person->doc_number = $input['doc_number'];
         $person->doc_type = $input['doc_type'];
         $person->email = $input['email'];
         $person->career = $input['career'];
         $person->state = 1;
         //para transformar a fecha
         $borndate = date("Y-m-d", strtotime($input['born_date']));
         $person->born_date = $borndate;
         $person->nationality = $input['nationality'];
         $person->academicdegree_id = $input['academicdegree_id'];
         $person->localization_id = $localizationController->getLocalizationId($input['localization_dept'], $input['localization_prov'], $input['localization_dist']);
         $person->save();
         $i = 0;
         foreach ($input['mobile_number'] as $mobil) {
             $phone = new Phone();
             $phone->person()->associate($person);
             $phone->mobile_number = $mobil;
             $phone->type = $input['phone_type'][$i];
             $phone->save();
             $i = $i + 1;
         }
         if (isset($input['notif1'])) {
             //asociar la persona a las notificaciones de tipo 1
             //$person->notifications()->save(Notification::find(1));
             $person->notifications()->attach(1);
             $person->notifications()->where('person_id', '=', $person->id)->update(array('state' => 1));
         }
         if (isset($input['notif2'])) {
             //asociar la persona a las notificaciones de tipo 1
             $person->notifications()->attach(2);
             $person->notifications()->where('person_id', '=', $person->id)->update(array('state' => 1));
         }
     });
     return Redirect::to('registro');
 }
開發者ID:alfonsobp,項目名稱:elprofeweb,代碼行數:43,代碼來源:PersonController.php

示例11: save

 public function save(ProfilePage $page, $field, $value)
 {
     $deletePrivate = S::user()->isMe($page->owner) || S::admin();
     Phone::deletePhones($page->pid(), Phone::LINK_ADDRESS, null, $deletePrivate);
     Address::deleteAddresses($page->pid(), Address::LINK_PROFILE, null, null, $deletePrivate);
     AddressReq::purge_requests($page->pid(), 0, 0, Address::LINK_PROFILE);
     Address::saveFromArray($value, $page->pid(), Address::LINK_PROFILE, null, $deletePrivate);
     if (S::user()->isMe($page->owner) && count($value) > 1) {
         Platal::page()->trigWarning('Attention, tu as plusieurs adresses sur ton profil. Pense à supprimer celles qui sont obsolètes.');
     }
 }
開發者ID:Ekleog,項目名稱:platal,代碼行數:11,代碼來源:addresses.inc.php

示例12: add_phone_number

 /**
  * Добавляет юзеру номер телефона, принимая объект номера телефона,
  * ассоциативный массив с кодом страны, кодом оператора и т.д. или
  * строку с неформатированым номером телефона.
  * Сохраняет телефонный номер в бд и возвращает его в случае успеха или
  * false при неудаче 
  */
 public function add_phone_number($phone)
 {
     if (gettype($phone) === 'array') {
         $phone = new Phone($phone);
     } else {
         if (gettype($phone) === 'string') {
             $params = array();
             $params['country_code'] = substr($phone, 0, 3);
             $params['operator_code'] = substr($phone, 3, -7);
             $params['phone_number'] = substr($phone, 5);
             $phone = new Phone($params);
         }
     }
     $phone->user_id = $this->id;
     if ($phone->save()) {
         $this->phones[] = $phone;
         return $phone;
     }
     return false;
 }
開發者ID:nomid,項目名稱:forforce,代碼行數:27,代碼來源:user.php

示例13: run

 public function run()
 {
     $faker = Faker::create();
     User::truncate();
     Phone::truncate();
     SMS::truncate();
     User::create(['name' => 'John', 'email' => 'senhorbardell@gmail.com', 'password' => 'test', 'birthday' => $faker->date($format = 'Y-m-d', $max = 'now'), 'sex' => true, 'city' => $faker->numberBetween(0, 3)]);
     foreach (range(1, 10) as $index) {
         User::create(['name' => $faker->firstName, 'email' => $faker->email, 'birthday' => $faker->date($format = 'Y-m-d', $max = 'now'), 'city' => 2, 'sex' => $faker->boolean(), 'about' => $faker->paragraph($nbSentences = 3), 'password' => 'test']);
     }
 }
開發者ID:SenhorBardell,項目名稱:yol,代碼行數:11,代碼來源:UsersTableSeeder.php

示例14: borrar_telefono

 public function borrar_telefono()
 {
     $id = Input::get('idedit');
     $telefono = Phone::find($id);
     if ($telefono->delete()) {
         Session::flash('message', 'Eliminado correctamente');
         Session::flash('class', 'success');
     } else {
         Session::flash('message', 'Ha ocurrido un error, intentelo nuevamente');
         Session::flash('class', 'danger');
     }
     return Redirect::to('telefono');
 }
開發者ID:bmrpas,項目名稱:SHREDDER,代碼行數:13,代碼來源:TelefonoController.php

示例15: checkType

 private function checkType($value, $name, $type)
 {
     switch ($type) {
         case 'email':
             if (!fnmatch('*@*.*', $value)) {
                 $this->addError("'{$name}' must be a valid email address.");
             }
             break;
         case 'phone':
             if (!Phone::validNumber($value)) {
                 $this->addError("'{$name}' must be a valid phone number.");
             }
             break;
     }
 }
開發者ID:Wicloz,項目名稱:UniversityWebsite,代碼行數:15,代碼來源:Validate.php


注:本文中的Phone類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。