PHP Class Users_model, 68kb

Inheritance: extends CI_Model
显示文件 Open project: 68kb/68kb Class Usage Examples

Public Methods

Method Description
__construct ( ) : void Constructor
add_user ( $data ) : mixed Add User
delete_user ( $user_id ) : boolean Delete User
edit_user ( $user_id, $data ) : boolean Edit User
email_check ( $email, $id = '' ) : boolean Checks if an email is already in use.
generate_api_key ( $length = 32 ) : string generate_api_key function.
get_user ( $query ) : array Get user
hash_pass ( $password ) : string Hash the password
reset_password ( $hash ) : boolean Resets a users password. Used by forgot password routine.
send_new_password ( $user_id ) ------------------------------------------------------------------------
update_api_key ( $user_api_key, $user_id ) : boolean Update the API key in the user table
update_login_info ( $user_id ) : void Update user login info, such as IP-address or login time.
user_notes ( $user_id ) : array User Notes
username_check ( $username, $id = '' ) : boolean Checks if a username is already in use.
users_listings ( $listing_owner_id ) : string Finds users active listings

Private Methods

Method Description
_get_user_by_id ( $user_id ) : mixed Get User By id
_get_user_by_username ( $user_name ) : mixed Get User By id

Method Details

__construct() public method

Constructor
public __construct ( ) : void
return void

add_user() public method

Add User
public add_user ( $data ) : mixed
return mixed

delete_user() public method

Delete User
public delete_user ( $user_id ) : boolean
return boolean

edit_user() public method

Edit User
public edit_user ( $user_id, $data ) : boolean
return boolean

email_check() public method

Checks if an email is already in use.
public email_check ( $email, $id = '' ) : boolean
return boolean

generate_api_key() public method

generate_api_key function.
public generate_api_key ( $length = 32 ) : string
return string

get_user() public method

Get user
public get_user ( $query ) : array
return array

hash_pass() public method

Hash the password
public hash_pass ( $password ) : string
return string

reset_password() public method

Resets a users password. Used by forgot password routine.
public reset_password ( $hash ) : boolean
return boolean

send_new_password() public method

------------------------------------------------------------------------
public send_new_password ( $user_id )

update_api_key() public method

Update the API key in the user table
public update_api_key ( $user_api_key, $user_id ) : boolean
return boolean

update_login_info() public method

Update user login info, such as IP-address or login time.
public update_login_info ( $user_id ) : void
return void

user_notes() public method

Get all notes for a user.
public user_notes ( $user_id ) : array
return array

username_check() public method

Checks if a username is already in use.
public username_check ( $username, $id = '' ) : boolean
return boolean

users_listings() public method

Finds users active listings
public users_listings ( $listing_owner_id ) : string
return string