9 namespace Fossology\UI\Api\Models;
22 const VERSION_1_KEYS = [
"username",
"password",
"token_name",
"token_scope",
28 const VERSION_2_KEYS = [
"username",
"password",
"tokenName",
"tokenScope",
111 $this->tokenExpire = DateTime::createFromFormat(
"Y-m-d",
$tokenExpire);
112 if ($this->tokenExpire ===
false) {
159 return $this->tokenExpire->format(
'Y-m-d');
186 if (! array_key_exists(
"username", $input)) {
187 $input[
"username"] =
"";
189 if (! array_key_exists(
"password", $input)) {
190 $input[
"password"] =
"";
192 if ($version == ApiVersion::V1) {
197 $input[
"token_name"],
198 $input[
"token_scope"],
199 $input[
"token_expire"],
209 $input[
"tokenScope"],
210 $input[
"tokenExpire"],
static arrayKeysExists(array $array, array $keys)
Check if a list of keys exists in associative array.
Provides various DAO helper functions for REST api.
setTokenScope(string $tokenScope)
static fromArray(array $input, int $version)
__construct(string $tokenName, string $tokenScope, string $tokenExpire, string $username="", string $password="")
setPassword(string $password)
setUsername(string $username)
setTokenName(string $tokenName)
setTokenExpire(string $tokenExpire)