42 $public = $this->crypto->getRandomString(40, Crypto::CHARS_HEX);
43 $secret = $this->crypto->getRandomString(40, Crypto::CHARS_HEX);
51 if ($this->database->insertData($insert) ===
false) {
67 public function getApiUser(
string $public_api_key,
bool $only_active =
true) {
76 return $this->database->getDataRow($select) ?:
false;
95 return (
bool) $this->database->deleteData(
$delete);
110 return (
bool) $this->database->updateData($update);
125 return (
bool) $this->database->updateData($update);
static table($table, $alias=null)
{}
const ELGG_VALUE_INTEGER
Value types.
__construct(Database $database, Crypto $crypto)
Create a new table handler.
Manage the contents of the api_users table.
enableAPIUser(string $public_api_key)
Enable an api user key.
static intoTable($table)
{}
getApiUser(string $public_api_key, bool $only_active=true)
Find an API User's details based on the provided public api key.
disableAPIUser(string $public_api_key)
Disable an api user key.
static fromTable($table, $alias=null)
{}
removeApiUser(string $public_api_key)
Revoke an api user key.
static fromTable($table, $alias=null)
{}
createApiUser()
Generate a new API user for a site, returning a new keypair on success.