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


PHP Network::getId方法代碼示例

本文整理匯總了PHP中Network::getId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Network::getId方法的具體用法?PHP Network::getId怎麽用?PHP Network::getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Network的用法示例。


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

示例1: setNetwork

 function setNetwork(Network $network)
 {
     $net = $this->mDb->escapeString($network->getId());
     $this->mDb->execSqlUpdate("UPDATE nodes SET network_id = '{$net}' WHERE node_id = '{$this->getId()}'");
     $this->refresh();
 }
開發者ID:cnlangzi,項目名稱:wifidog-auth,代碼行數:6,代碼來源:Node.php

示例2: createUser

 /** Create a new User in the database
  * @param $id The id to be given to the new user
  * @return the newly created User object, or null if there was an error
  */
 static function createUser($id, $username, Network $account_origin, $email, $password)
 {
     $db = AbstractDb::getObject();
     $object = null;
     $id_str = $db->escapeString($id);
     $username_str = $db->escapeString($username);
     $account_origin_str = $db->escapeString($account_origin->getId());
     $email_str = $db->escapeString($email);
     $password_hash = $db->escapeString(User::passwordHash($password));
     $status = ACCOUNT_STATUS_VALIDATION;
     $token = User::generateToken();
     $db->execSqlUpdate("INSERT INTO users (user_id,username, account_origin,email,pass,account_status,validation_token,reg_date) VALUES ('{$id_str}','{$username_str}','{$account_origin_str}','{$email_str}','{$password_hash}','{$status}','{$token}',CURRENT_TIMESTAMP)");
     $object = self::getObject($id);
     return $object;
 }
開發者ID:soitun,項目名稱:wifidog-auth,代碼行數:19,代碼來源:User.php

示例3:

 /**
  * Set this vhost's default network
  *
  * @return bool True on success, false on failure
  */
 public function &setDefaultNetwork(Network $network)
 {
     $db = AbstractDb::getObject();
     // Init values
     $retVal = true;
     if ($network != $this->getDefaultNetwork()) {
         $value = $db->escapeString($network->getId());
         $retVal = $db->execSqlUpdate("UPDATE virtual_hosts SET default_network = '{$value}' WHERE virtual_host_id = '{$this->getId()}'", false);
         $this->refresh();
     }
     return $retVal;
 }
開發者ID:cnlangzi,項目名稱:wifidog-auth,代碼行數:17,代碼來源:VirtualHost.php


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