本文整理匯總了PHP中User_Model::get_id方法的典型用法代碼示例。如果您正苦於以下問題:PHP User_Model::get_id方法的具體用法?PHP User_Model::get_id怎麽用?PHP User_Model::get_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類User_Model
的用法示例。
在下文中一共展示了User_Model::get_id方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: register
/**
* Register new user
*
* @access public
* @return string Returns "OK" string upon succession and error message otherwise
*/
public function register()
{
$xml = apiler::get_xml();
try {
$user = new User_Model($xml->login, $xml->password, $xml->email, $xml->description);
$this->store_avatar($user->get_id($xml->login));
echo "OK";
} catch (Exception $e) {
echo $e->getMessage() . "\n";
die;
}
}
示例2: insert
public function insert($category, $username, $value)
{
$cat = new Category_Model();
$category = $cat->get_id($category);
$user = new User_Model();
$username = $user->get_id($username);
$results = $this->db->query("INSERT INTO results SET cat_id = ?, user_id = ?, value = ?, result_date = NOW()", $category, $username, $value);
if ($results) {
return true;
} else {
return false;
}
}
示例3: change_data
/**
* Change user profile
* @param array post data
* @param string user id
*/
public function change_data($post, $email)
{
$user = new User_Model();
$id = $user->get_id($email);
if (self::profile_exists($email)) {
//update data
$data = array('customer_street' => $post['customer_street'], 'customer_city' => $post['customer_city'], 'customer_postal_code' => $post['customer_postal_code'], 'customer_phone' => $post['customer_phone'], 'billing_name' => $post['billing_name'], 'billing_street' => $post['billing_street'], 'billing_city' => $post['billing_city'], 'billing_postal_code' => $post['billing_postal_code'], 'billing_identity_number' => $post['billing_identity_number'], 'billing_vat_number' => $post['billing_vat_number']);
$this->db->update(self::TN_EXTEND, $data, array('user' => $id));
} else {
//create data
$data['user'] = $id;
$this->db->insert(self::TN_EXTEND, $data);
}
}
示例4: user_id
/**
* Return ID of current user
* @return integer ID of user
*/
public function user_id()
{
$user = new User_Model();
return $user->get_id(self::user_email());
}