本文整理汇总了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();
}
示例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;
}
示例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;
}