Methods summary
public
|
#
__construct( integer $id = null, ElggUser $elgg_user = null )
Constructor
Parameters
- $id
integer $id If !null, load instance.
- $elgg_user
ElggUser
$elgg_user Object to load instance from (optional)
Throws
Overrides
|
protected
|
#
copy_from_elgg( ElggUser $elgg_user )
Loads a User instance from the system.
Loads a User instance from the system.
Parameters
- $elgg_user
ElggUser
$elgg_user User to load from the system.
Overrides
|
protected
boolean|integer
|
#
save( )
Saves this instance to the system.
Saves this instance to the system.
Returns
boolean|integer Returns id of saved instance, or false if error.
Overrides
|
protected
|
#
copy_to_elgg( ElggUser $elgg_user )
Copy $this user parameters into an Elgg User entity.
Copy $this user parameters into an Elgg User entity.
Parameters
- $elgg_user
ElggUser
$elgg_user Elgg User object instance to save $this to
Overrides
|
protected static
boolean
|
#
create_password( string $clear_password )
Creates an encoded user password using a random hash for encoding.
Creates an encoded user password using a random hash for encoding.
Parameters
- $clear_password
string $clear_password The new user password in clear text.
Returns
boolean 'true' if success, 'false' if error.
|
public static
integer|boolean
|
#
set_properties( integer $id, array $prop_value_array )
Sets values to specified properties of a User
Sets values to specified properties of a User
Parameters
- $id
integer $id Id of User to set property values
- $prop_value_array
array $prop_value_array Array of property=>value pairs to set into the User
Returns
integer|boolean Returns Id of User if correct, or false if error
Throws
Overrides
|
public static
boolean
|
#
login( string $login, string $password, boolean $persistent = false )
Authenticate a user and log him into the system.
Authenticate a user and log him into the system.
Parameters
- $login
string $login User login
- $password
string $password User password
- $persistent
boolean $persistent Determines whether to make the session persistent
Returns
boolean Returns true if ok, or false if error
|
public static
boolean
|
#
logout( )
Logs out a user from the system.
Logs out a user from the system.
Returns
boolean Returns true if ok, or false if error.
|
public static
static[]
|
#
get_by_login( array $login_array )
Get users with login contained in a given list of logins.
Get users with login contained in a given list of logins.
Parameters
- $login_array
array $login_array Array of user logins
Returns
static[] Returns an array of User objects
|
public static
static[]
|
#
get_by_email( array $email_array )
Get users with email contained in a given list of emails. Each email can be
associated with multiple users. The output will be an array of Users per login,
nested inside a main array.
Get users with email contained in a given list of emails. Each email can be
associated with multiple users. The output will be an array of Users per login,
nested inside a main array.
Parameters
- $email_array
array $email_array Array of user emails
Returns
static[] Returns an array of arrays of User objects
|
public static
static[]
|
#
get_by_role( array $role_array )
Get users with role contained in a given list of roles.
Get users with role contained in a given list of roles.
Parameters
- $role_array
array $role_array Array of user roles
Returns
static[] Returns an array of [role] => array(Users)
|
public static
integer|boolean
|
#
get_last_login( integer $id )
Get a User's last login timestamp.
Get a User's last login timestamp.
Parameters
Returns
integer|boolean Last login timestamp, or false in case of error
|
public static
integer|false
|
#
set_avatar( integer $id, integer $file_id )
Sets the avatar for a User
Sets the avatar for a User
Parameters
- $id
integer $id User ID
- $file_id
integer $file_id Id of the image file containing the User's avatar
Returns
integer|false Returns the ID of the User, or false if error.
|
public static
array|null
|
#
get_avatar( integer $id, string $size = "medium" )
Returns the avatar for a User
Returns the avatar for a User
Parameters
- $id
integer $id User ID
- $size
string $size Desired size of avatar image: small, medium or large.
Returns
array|null Returns an array with 2 elements: "url" => <avatar_url> and "path"
=> <avatar_path>, or null if none.
|
public static
array|null
|
#
import_data( string $file_path )
Add Users from an Excel file, and return an array of User Ids from those
created or selected from the file.
Add Users from an Excel file, and return an array of User Ids from those
created or selected from the file.
Parameters
- $file_path
string $file_path Local file path
Returns
array|null Array of User IDs, or null if error.
|