mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 13:12:41 +00:00
Add missing API documentation
This commit is contained in:
parent
65b1bb4fcd
commit
336207741d
1 changed files with 16 additions and 1 deletions
|
@ -41,7 +41,8 @@ use JKingWeb\Arsse\Rule\Exception as RuleException;
|
||||||
* concerns, will typically follow different conventions.
|
* concerns, will typically follow different conventions.
|
||||||
*
|
*
|
||||||
* Note that operations on users should be performed with the User class rather
|
* Note that operations on users should be performed with the User class rather
|
||||||
* than the Database class directly. This is to allow for alternate user sources.
|
* than the Database class directly. This is to allow for alternate user
|
||||||
|
* databases e.g. LDAP, although not such support for alternatives exists yet.
|
||||||
*/
|
*/
|
||||||
class Database {
|
class Database {
|
||||||
/** The version number of the latest schema the interface is aware of */
|
/** The version number of the latest schema the interface is aware of */
|
||||||
|
@ -275,6 +276,10 @@ class Database {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Renames a user
|
||||||
|
*
|
||||||
|
* This does not have an effect on their numeric ID, but has a cascading effect on many tables
|
||||||
|
*/
|
||||||
public function userRename(string $user, string $name): bool {
|
public function userRename(string $user, string $name): bool {
|
||||||
if ($user === $name) {
|
if ($user === $name) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -328,6 +333,11 @@ class Database {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Retrieves any metadata associated with a user
|
||||||
|
*
|
||||||
|
* @param string $user The user whose metadata is to be retrieved
|
||||||
|
* @param bool $includeLarge Whether to include values which can be arbitrarily large text
|
||||||
|
*/
|
||||||
public function userPropertiesGet(string $user, bool $includeLarge = true): array {
|
public function userPropertiesGet(string $user, bool $includeLarge = true): array {
|
||||||
$basic = $this->db->prepare("SELECT num, admin from arsse_users where id = ?", "str")->run($user)->getRow();
|
$basic = $this->db->prepare("SELECT num, admin from arsse_users where id = ?", "str")->run($user)->getRow();
|
||||||
if (!$basic) {
|
if (!$basic) {
|
||||||
|
@ -345,6 +355,11 @@ class Database {
|
||||||
return $meta;
|
return $meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Set one or more metadata properties for a user
|
||||||
|
*
|
||||||
|
* @param string $user The user whose metadata is to be sedt
|
||||||
|
* @param array $data An associative array of property names and values
|
||||||
|
*/
|
||||||
public function userPropertiesSet(string $user, array $data): bool {
|
public function userPropertiesSet(string $user, array $data): bool {
|
||||||
if (!$this->userExists($user)) {
|
if (!$this->userExists($user)) {
|
||||||
throw new User\ExceptionConflict("doesNotExist", ["action" => __FUNCTION__, "user" => $user]);
|
throw new User\ExceptionConflict("doesNotExist", ["action" => __FUNCTION__, "user" => $user]);
|
||||||
|
|
Loading…
Reference in a new issue