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