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

Manage the contents of the api_users table. More...

Public Member Functions

 __construct (Database $database, Crypto $crypto)
 Create a new table handler. More...
 
 createApiUser ()
 Generate a new API user for a site, returning a new keypair on success. More...
 
 getApiUser (string $public_api_key, bool $only_active=true)
 Find an API User's details based on the provided public api key. More...
 
 removeApiUser (string $public_api_key)
 Revoke an api user key. More...
 
 enableAPIUser (string $public_api_key)
 Enable an api user key. More...
 
 disableAPIUser (string $public_api_key)
 Disable an api user key. More...
 

Protected Attributes

 $database
 
 $crypto
 
 $table = 'api_users'
 

Detailed Description

Manage the contents of the api_users table.

Since
4.0

Definition at line 14 of file ApiUsersTable.php.

Constructor & Destructor Documentation

Elgg\Database\ApiUsersTable::__construct ( Database  $database,
Crypto  $crypto 
)

Create a new table handler.

Parameters
Database$databasethe Elgg database handler
Crypto$cryptocrypto handler

Definition at line 37 of file ApiUsersTable.php.

Member Function Documentation

Elgg\Database\ApiUsersTable::createApiUser ( )

Generate a new API user for a site, returning a new keypair on success.

Returns
false| object or false

Definition at line 47 of file ApiUsersTable.php.

Elgg\Database\ApiUsersTable::disableAPIUser ( string  $public_api_key)

Disable an api user key.

Parameters
string$public_api_keyThe API Key (public)
Returns
bool

Definition at line 131 of file ApiUsersTable.php.

Elgg\Database\ApiUsersTable::enableAPIUser ( string  $public_api_key)

Enable an api user key.

Parameters
string$public_api_keyThe API Key (public)
Returns
bool

Definition at line 116 of file ApiUsersTable.php.

Elgg\Database\ApiUsersTable::getApiUser ( string  $public_api_key,
bool  $only_active = true 
)

Find an API User's details based on the provided public api key.

These users are not users in the traditional sense.

Parameters
string$public_api_keyThe API Key (public)
bool$only_activeOnly return if the API key is active (default: true)
Returns
false| stdClass representing the database row or false

Definition at line 73 of file ApiUsersTable.php.

Elgg\Database\ApiUsersTable::removeApiUser ( string  $public_api_key)

Revoke an api user key.

Parameters
string$public_api_keyThe API Key (public)
Returns
bool

Definition at line 97 of file ApiUsersTable.php.

Member Data Documentation

Elgg\Database\ApiUsersTable::$crypto
protected

Definition at line 24 of file ApiUsersTable.php.

Elgg\Database\ApiUsersTable::$database
protected

Definition at line 19 of file ApiUsersTable.php.

Elgg\Database\ApiUsersTable::$table = 'api_users'
protected

Definition at line 29 of file ApiUsersTable.php.


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