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


PHP Validator::UniqueKey方法代码示例

本文整理汇总了PHP中Validator::UniqueKey方法的典型用法代码示例。如果您正苦于以下问题:PHP Validator::UniqueKey方法的具体用法?PHP Validator::UniqueKey怎么用?PHP Validator::UniqueKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Validator的用法示例。


在下文中一共展示了Validator::UniqueKey方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: set

 public function set($name, $seat, $desc)
 {
     $this->Id = Validator::UniqueKey();
     $this->desc = $desc;
     $this->seats = $seat;
     $this->name = $name;
     $this->mode = null;
 }
开发者ID:jimobama,项目名称:app,代码行数:8,代码来源:Plane.php

示例2: set

 public function set($seatNo, $planeId, $desc, $type, $rate)
 {
     $this->seatNo = $seatNo;
     $this->planeID = $planeId;
     $this->type = $type;
     $this->desc = $desc;
     $this->rate = $rate;
     $this->id = Validator::UniqueKey();
 }
开发者ID:jimobama,项目名称:app,代码行数:9,代码来源:Seat.php

示例3: __construct

 function __construct($creatorId = null, $title = null, $venue = null, $type = null)
 {
     $this->__startDate = "" . (intval(Validator::Now()) + 1 * 24 * 60 * 60);
     $this->__id = Validator::UniqueKey(14) . "" . TryFetchUserEvent::count();
     $this->setCreatorId($creatorId);
     $this->setTitle($title);
     $this->setVenue($venue);
     $this->setType($type);
     $this->setCreateDate(Validator::Now());
 }
开发者ID:jimobama,项目名称:fffddffd,代码行数:10,代码来源:Event.php

示例4: __construct

 public function __construct($flight_id = NULL, $ticket_cat = NULL, $ticket_type = NULL, $adult = 0, $child = 0, $price = 0.0)
 {
     parent::__construct();
     $this->flight_id = $flight_id;
     $this->children_no = $child;
     $this->adult_no = $adult;
     $this->ticket_cat = $ticket_cat;
     $this->ticket_type = $ticket_type;
     $this->ticket_adult_price = $price;
     $this->id = Validator::UniqueKey();
 }
开发者ID:jimobama,项目名称:app,代码行数:11,代码来源:BookInfo.php

示例5: set

 public function set($planeId, $from, $to, $deptdate, $landingDate, $boardingTime, $LandingTime, $ticketPrice, $stops)
 {
     $this->from = $from;
     $this->to = $to;
     $this->deptureDate = $deptdate;
     $this->landindDate = $landingDate;
     $this->boardingTime = $boardingTime;
     $this->Landingtime = $LandingTime;
     $this->ticketPrice = $ticketPrice;
     $this->stops = $stops;
     $this->Id = Validator::UniqueKey();
     $this->planeID = $planeId;
 }
开发者ID:jimobama,项目名称:app,代码行数:13,代码来源:Flight.php

示例6: update

 public function update()
 {
     $query = "Update " . UserTable::TableName . " set " . UserTable::VerificationCode . "=:code where  " . UserTable::UserName . "=:email";
     $stmt = $this->db->prepare($query);
     $code = Validator::UniqueKey(4);
     $stmt->bindValue(":email", $this->email);
     $stmt->bindValue(":code", $code);
     if ($stmt->execute() && $stmt->rowCount() > 0) {
         return $code;
     } else {
         return null;
     }
 }
开发者ID:jimobama,项目名称:fffddffd,代码行数:13,代码来源:TryResetPassword.php

示例7: set

 public final function set($firstname, $lastname, $email, $phone, $password)
 {
     $firstname = $firstname == "null" ? null : $firstname;
     $lastname = $lastname == "null" ? null : $lastname;
     $email = $email == "null" ? null : $email;
     $password = $password == "null" ? null : $password;
     $phone = $phone == "null" ? null : $phone;
     $this->agentId = Validator::UniqueKey() . "" . Validator::UniqueKey();
     $this->firstname = $firstname;
     $this->lastname = $lastname;
     $this->email = $email;
     $this->phonenumber = $phone;
     $this->password = $password;
     $this->date_reqistered = Date("d/m/Y", time());
 }
开发者ID:jimobama,项目名称:app,代码行数:15,代码来源:Agent.php

示例8: create

 public function create()
 {
     $this->db->create(new UserTable());
     $okay = false;
     $sql = "Insert Into " . UserTable::TableName . "(" . UserTable::FullName . "," . UserTable::ID . "," . UserTable::UserName . "," . UserTable::Gender . "," . UserTable::LastUpdateDate . "," . UserTable::RegisterDate . "," . UserTable::Status . "," . UserTable::VerificationCode . ")" . " Values" . "(:fullname,:id,:email,:gender,:lastupdate,:registerDate,:status,:vcode)";
     //set the fields values
     $now = Validator::Now();
     $stmt = $this->db->prepare($sql);
     $stmt->bindValue(":fullname", trim($this->user->getFullname()));
     $stmt->bindValue(":id", Validator::UniqueKey(8));
     $stmt->bindValue(":email", addslashes(strtolower(trim($this->user->getEmail()))));
     $stmt->bindValue(":gender", $this->user->getGender());
     $stmt->bindValue(":lastupdate", $now);
     $stmt->bindValue(":registerDate", $now);
     $stmt->bindValue(":status", 0);
     $stmt->bindValue(":vcode", $this->user->getVerificationCode());
     $abool = $stmt->execute();
     if ($abool && $stmt->rowCount() > 0) {
         $okay = true;
     }
     return $okay;
 }
开发者ID:jimobama,项目名称:fffddffd,代码行数:22,代码来源:TryCreateUser.php

示例9: tryCreate

 private function tryCreate(User $user)
 {
     $tryFetchUser = new TryFetchUser();
     $response = array();
     $response["success"] = 0;
     if ($tryFetchUser->fetch($user->getEmail()) == null) {
         $user->setVerificationCode(Validator::UniqueKey(4));
         $tryCreate = new TryCreateUser($user);
         $abool = $tryCreate->create();
         if ($abool) {
             $response["success"] = 1;
             $user = $tryFetchUser->fetch($user->getEmail());
             $response["user"] = $user;
             $this->sendWelcomeMessage(json_encode($user));
         } else {
             $response["error_message"] = "report this problem please!";
         }
     } else {
         $email = $user->getEmail();
         $response["error_message"] = "The [{$email}] account already exists ";
     }
     return $response;
 }
开发者ID:jimobama,项目名称:fffddffd,代码行数:23,代码来源:TryCreateUserController.php

示例10: Create

 function Create($email, $firstname, $lastname, $phone, $password, $repassword, $sendButton = null)
 {
     $repassword = $repassword == "null" ? null : $repassword;
     $agent = new Agent();
     $agent->set($firstname, $lastname, $email, $phone, $password);
     $agentModel = new AgentModel($agent);
     $list = $agentModel->GetUsers();
     $this->agentModelView->agent = $agent;
     $this->agentModelView->agentList = $list;
     if ($agent->validated()) {
         if ($password != $repassword) {
             Session::set("warning", " Password mis-matched, re-enter passwords again!");
             return $this->View($this->agentModelView, "Agent", "Create");
         } else {
             $this->agentModelView->agentDbModel = $agentModel;
             if ($agentModel->Exists()) {
                 Session::set("warning", "The user with the given email address [{$email}] already exists!");
             } else {
                 try {
                     //else create the user
                     if ($agentModel->Create()) {
                         $sessionID = Validator::UniqueKey(20);
                         $agentModel->SaveVerificationCode($email, $sessionID);
                         //create a barcode
                         $param = new ArrayIterator();
                         $param->offsetSet("username", $agent->email);
                         $param->offsetSet("verificationCode", $sessionID);
                         $url = ContextManager::CreateURL("Agent", "Login", $param);
                         $imgPath = ContextManager::CreateQRBarcode($url, $agent->agentId);
                         if ($this->_sendVerificationEmail($agent, $sessionID, $imgPath)) {
                             //navigate to comfirmation page
                             return $this->View($agent, "Agent", "Confirmation");
                         } else {
                             Session::set("warning", "could not send mail ");
                             $agentModel->DeleteAgent($email);
                         }
                     }
                 } catch (Exception $err) {
                     Session::set("warning", $err->getMessage());
                 }
             }
         }
         // create a database record here
     } else {
         Session::set("warning", $agent->getError());
     }
     return $this->View($this->agentModelView, "Agent", "Create");
 }
开发者ID:jimobama,项目名称:app,代码行数:48,代码来源:AgentController.php

示例11: __construct

 function __construct()
 {
     $this->parkUniqueId = Validator::UniqueKey(10);
     $this->geolocation = new GeoPosition(0.0, 0.0);
     $this->date_added = Validator::Now();
 }
开发者ID:jimobama,项目名称:fffddffd,代码行数:6,代码来源:ParkLocation.php


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