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

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

Public Member Functions

 __construct (protected Database $database, protected 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...
 

Public Attributes

const TABLE_NAME = '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 ( protected Database  $database,
protected Crypto  $crypto 
)

Create a new table handler.

Parameters
Database$databasethe Elgg database handler
Crypto$cryptocrypto handler

Definition at line 27 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 35 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 114 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 99 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 61 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 80 of file ApiUsersTable.php.

Member Data Documentation

const Elgg\Database\ApiUsersTable::TABLE_NAME = 'api_users'

Definition at line 19 of file ApiUsersTable.php.


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