mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-24 09:32:40 +00:00
43 lines
No EOL
1.5 KiB
PHP
43 lines
No EOL
1.5 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
namespace JKingWeb\NewsSync\User;
|
|
use JKingWeb\NewsSync\Lang;
|
|
|
|
final class DriverInternal implements Driver {
|
|
use InternalFunctions;
|
|
|
|
protected $data;
|
|
protected $db;
|
|
protected $functions = [
|
|
"auth" => Driver::FUNC_INTERNAL,
|
|
"userList" => Driver::FUNC_INTERNAL,
|
|
"userExists" => Driver::FUNC_INTERNAL,
|
|
"userAdd" => Driver::FUNC_INTERNAL,
|
|
"userRemove" => Driver::FUNC_INTERNAL,
|
|
"userPasswordSet" => Driver::FUNC_INTERNAL,
|
|
"userPropertiesGet" => Driver::FUNC_INTERNAL,
|
|
"userPropertiesSet" => Driver::FUNC_INTERNAL,
|
|
"userRightsGet" => Driver::FUNC_INTERNAL,
|
|
"userRightsSet" => Driver::FUNC_INTERNAL,
|
|
];
|
|
|
|
static public function create(\JKingWeb\NewsSync\RuntimeData $data): Driver {
|
|
return new static($data);
|
|
}
|
|
|
|
static public function driverName(): string {
|
|
$name = str_replace(Driver::class, "", static::class);
|
|
return Lang::msg("Driver.User.$name.Name");
|
|
}
|
|
|
|
public function driverFunctions(string $function = null) {
|
|
if($function===null) return $this->functions;
|
|
if(array_key_exists($function, $this->functions)) {
|
|
return $this->functions[$function];
|
|
} else {
|
|
return Driver::FUNC_NOT_IMPLEMENTED;
|
|
}
|
|
}
|
|
|
|
// see InternalFunctions.php for bulk of methods
|
|
} |