36 $public = $this->crypto->getRandomString(40, Crypto::CHARS_HEX);
37 $secret = $this->crypto->getRandomString(40, Crypto::CHARS_HEX);
45 if ($this->database->insertData($insert) ===
false) {
61 public function getApiUser(
string $public_api_key,
bool $only_active =
true) {
70 return $this->database->getDataRow($select) ?:
false;
89 return (
bool) $this->database->deleteData(
$delete);
104 return (
bool) $this->database->updateData($update);
119 return (
bool) $this->database->updateData($update);
static table(string $table)
Returns a QueryBuilder for updating data in a given table.
const ELGG_VALUE_INTEGER
Value types.
Manage the contents of the api_users table.
static intoTable(string $table)
Returns a QueryBuilder for inserting data in a given table.
enableAPIUser(string $public_api_key)
Enable an api user key.
__construct(protected Database $database, protected Crypto $crypto)
Create a new table handler.
static fromTable(string $table)
Returns a QueryBuilder for deleting data from a given 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(string $table, string $alias=null)
Returns a QueryBuilder for selecting data from a given table.
removeApiUser(string $public_api_key)
Revoke an api user key.
createApiUser()
Generate a new API user for a site, returning a new keypair on success.