Elgg  Version 3.0
Public Member Functions | Protected Attributes | List of all members
Elgg\Database\UsersTable Class Reference

WARNING: API IN FLUX. More...

Public Member Functions

 __construct (Conf $config, Database $db, MetadataTable $metadata)
 Constructor. More...
 
 getByUsername ($username)
 Get user by username. More...
 
 getByEmail ($email)
 Get an array of users from an email address. More...
 
 findActive (array $options=[])
 Return users (or the number of them) who have been active within a recent period. More...
 
 register ($username, $password, $name, $email, $allow_multiple_emails=false, $subtype=null)
 Registers a user, returning false if the username already exists. More...
 
 generateInviteCode ($username)
 Generates a unique invite code for a user. More...
 
 validateInviteCode ($username, $code)
 Validate a user's invite code. More...
 

Protected Attributes

 $config
 
 $db
 
 $metadata
 

Detailed Description

WARNING: API IN FLUX.

DO NOT USE DIRECTLY.

Definition at line 22 of file UsersTable.php.

Constructor & Destructor Documentation

Elgg\Database\UsersTable::__construct ( Conf  $config,
Database  $db,
MetadataTable  $metadata 
)

Constructor.

Parameters
Conf$configConfig
Database$dbDatabase
MetadataTable$metadataMetadata table

Definition at line 48 of file UsersTable.php.

Member Function Documentation

Elgg\Database\UsersTable::findActive ( array  $options = [])

Return users (or the number of them) who have been active within a recent period.

Parameters
array$optionsArray of options with keys:

seconds (int) => Length of period (default 600 = 10min) limit (int) => Limit (default 10) offset (int) => Offset (default 0) count (bool) => Return a count instead of users? (default false)

Returns
[]|int

Definition at line 130 of file UsersTable.php.

Elgg\Database\UsersTable::generateInviteCode (   $username)

Generates a unique invite code for a user.

Parameters
string$usernameThe username of the user sending the invitation
Returns
string Invite code
See also
validateInviteCode

Definition at line 197 of file UsersTable.php.

Elgg\Database\UsersTable::getByEmail (   $email)

Get an array of users from an email address.

Parameters
string$emailEmail address
Returns
[]

Definition at line 98 of file UsersTable.php.

Elgg\Database\UsersTable::getByUsername (   $username)

Get user by username.

Parameters
string$usernameThe user's username
Returns
ElggUser|false Depending on success

Definition at line 61 of file UsersTable.php.

Elgg\Database\UsersTable::register (   $username,
  $password,
  $name,
  $email,
  $allow_multiple_emails = false,
  $subtype = null 
)

Registers a user, returning false if the username already exists.

Parameters
string$usernameThe username of the new user
string$passwordThe password
string$nameThe user's display name
string$emailThe user's email address
bool$allow_multiple_emailsAllow the same email address to be registered multiple times?
string$subtypeSubtype of the user entity
Returns
int|false The new user's GUID; false on failure
Exceptions
RegistrationException

Definition at line 185 of file UsersTable.php.

Elgg\Database\UsersTable::validateInviteCode (   $username,
  $code 
)

Validate a user's invite code.

Parameters
string$usernameThe username
string$codeThe invite code
Returns
bool
See also
generateInviteCode

Definition at line 211 of file UsersTable.php.

Member Data Documentation

Elgg\Database\UsersTable::$config
protected

Definition at line 29 of file UsersTable.php.

Elgg\Database\UsersTable::$db
protected

Definition at line 34 of file UsersTable.php.

Elgg\Database\UsersTable::$metadata
protected

Definition at line 39 of file UsersTable.php.


The documentation for this class was generated from the following file: