Index

tClient

MMO\oauth\classes · 1 symbol · generated 5 Oct 2026

trait

tClient

tClient.php:13

Model for client

trait MMO\oauth\classes\tClient use MMO\oauth\classes\tWithRoles
Namespace
MMO\oauth\classes
Uses traits
tWithRoles

Index

clientFlagsClient flags
config
rolesRoles associated with the token.
scopes
addRole($role)
allow($uids)Add scope if it is not already disallowed
applyScopes($scopes, $set)Apply this scopes onto a list of scopes
blameOwnScope($uid)
blameScope($uid)
clearRoles()
clearScopes()
disallow($uids)
getClientFlagsText($separator)Get the flags as text
getConfig()
getOwnScope($uid)
getOwnScopes()Return an array of scopes associated with the token.
getRoles()
getScope($uid)
getScopes()Return an array of scopes associated with the token.
hasClientFlag($flag)
hasRole($role)
hasScope($uid)
isAllowed($uids)Test if all scopes are allowed
isAnyAllowed($uids)Test if any scope is allowed Scopes expressed as string can be a list of scope's uid seperated by a space (in this case, all scopes MUST be allowed).
markChanged($keys) abstractRecord that properties changed (scopes), so they are saved: aEntity::markChanged
removeRole($role)
scopesText($separator, $true, $false)
setRoles($roles)
setScope($uid, $value)Set the scope's value
setScopes($scopes)
updateClientFlag($flag, $value)
verifySecret($pwd)

Properties4

clientFlags

Client flags

#[MMO\core\attributes\ArrayProperty()] protected int $clientFlags = 0
Type
int

config

#[MMO\core\attributes\ArrayProperty()] protected array $config = []
Type
array

roles

Roles associated with the token.

#[MMO\core\attributes\ArrayProperty(schema: '[MMO\\oauth\\entities\\Role]')] protected array $roles = []
Type
array

scopes

#[MMO\core\attributes\Serialize(serialize: 'getOwnScopes')] #[MMO\core\attributes\ArrayProperty(schema: '{...: bool}')] protected array $scopes = []
Type
array

Methods28

allow($uids)

tWithScopes.php:100

Add scope if it is not already disallowed

function allow(object|string ...$uids): void
...$uidsobject | stringlist of scope's uid separated by space or a list of uid
returnsvoid

applyScopes($scopes, $set)

tWithScopes.php:136

Apply this scopes onto a list of scopes

function applyScopes(array &$scopes, bool $set = false): void
$scopesarraylist of {scope:uid} => {allow:bool}
$set = falseboolmergeScopes
returnsvoid

getClientFlagsText($separator)

tClient.php:64

Get the flags as text

function getClientFlagsText(?string $separator = ','): array|string
$separator = ','null | stringif null, will return an array
returnsarray | string

getOwnScopes()

tWithScopes.php:40

Return an array of scopes associated with the token.

function getOwnScopes(): array
returnsarraybool>

getScopes()

tWithRoles.php:79

Return an array of scopes associated with the token.

function getScopes(): array
returnsarrayiScope>

isAnyAllowed($uids)

tWithScopes.php:125

Test if any scope is allowed Scopes expressed as string can be a list of scope's uid seperated by a space (in this case, all scopes MUST be allowed).

function isAnyAllowed(object|string ...$uids): bool
...$uidsobject | string
returnsbool

scopesText($separator, $true, $false)

tWithScopes.php:44
function scopesText(string $separator = ' | ', string $true = '✓', string $false = '✗'): string
$separator = ' | 'string
$true = '✓'string
$false = '✗'string
returnsstring

setScope($uid, $value)

tWithScopes.php:65

Set the scope's value

function setScope(object|string $uid, ?bool $value): void
$uidobject | string
$valuenull | boolif null, remove the scope from the list of scopes
returnsvoid

updateClientFlag($flag, $value)

tClient.php:47
function updateClientFlag(int $flag, bool $value = true): bool
$flagint
$value = truebool
returnsbool