本文整理汇总了PHP中User_Model::setUsername方法的典型用法代码示例。如果您正苦于以下问题:PHP User_Model::setUsername方法的具体用法?PHP User_Model::setUsername怎么用?PHP User_Model::setUsername使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User_Model
的用法示例。
在下文中一共展示了User_Model::setUsername方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createObjectFromData
public function createObjectFromData($row)
{
//Create a new user_model object
$user = new User_Model();
//Set the ID on the user model
$user->setId($row->id);
//Set the username on the user model
$user->setUsername($row->username);
//Set the password on the user model
$user->setPassword($row->password);
//Return the new user object
return $user;
}
示例2:
function get_user_info($user_id)
{
$userinfo = false;
if ($user_id && (int) $user_id > 0) {
$CI =& get_instance();
$query = $CI->db->select("*")->from("cs_users")->where(array("user_id" => $user_id))->get();
if ($query && $query->num_rows() == 1) {
$CI->load->model("user_model");
$userinfo = new User_Model();
$rw = $query->row();
$userinfo->setUsername($rw->username);
$userinfo->setUserid($rw->user_id);
$userinfo->setPassword($rw->password);
$userinfo->setStatus($rw->status);
$userinfo->setLevel($rw->level);
$userinfo->setType($rw->type);
$userinfo->setCreatedon($rw->created_on);
$userinfo->setLastupdate($rw->last_update);
}
}
return $userinfo;
}
示例3: createObjectFromData
public function createObjectFromData($row)
{
$user = new User_Model();
$user->setId($row->userID);
$user->setUsername($row->username);
$user->setPassword($row->password);
$user->setSalt($row->salt);
$user->setEmail($row->email);
$user->setFirstName($row->firstname);
$user->setLastName($row->lastname);
$user->setUserType($row->userType);
$user->setDivision($row->divisionID);
$user->setDivisionName($row->name);
$user->setDivisionDescription($row->description);
$user->setStatus($row->status);
return $user;
}