MiscService
in package
Uses
TArrayTools
Table of Contents
- $TYPE_ARRAY : mixed
- $TYPE_BOOLEAN : mixed
- $TYPE_INTEGER : mixed
- $TYPE_NULL : mixed
- $TYPE_SERIALIZABLE : mixed
- $TYPE_STRING : mixed
- $appName : string
- $contactsStore : IContactsStore
- $logger : ILogger
- $userManager : IUserManager
- __construct() : mixed
- asyncAndLeaveClientOutOfThis() : mixed
- Hacky way to async the rest of the process without keeping client on hold.
- e() : mixed
- fail() : DataResponse
- generateClientBodyData() : array<string|int, mixed>
- get() : array<string|int, mixed>|string
- getContactData() : mixed|string
- getContactDisplayName() : string
- getDisplay() : string
- getDisplayName() : string
- return Display Name if user exists and display name exists.
- getInfosFromContact() : array<string|int, mixed>
- getRealUserId() : string
- return the real userId, with its real case
- log() : mixed
- mustContains() : mixed
- success() : DataResponse
- token() : string
- Generate uuid: 2b5a7a87-8db1-445f-a17b-405790f91c80
- typeOf() : string
- validKey() : bool
- cleanArray() : mixed
- extractArray() : mixed
- getArray() : array<string|int, mixed>
- getBool() : bool
- getFloat() : float
- getInt() : int
- getList() : array<string|int, mixed>
- getObj() : mixed
- getDisplayContact() : mixed
- getDisplayContactFromArray() : mixed
- getDisplayMember() : mixed
Properties
$TYPE_ARRAY
public
static mixed
$TYPE_ARRAY
= 'Array'
$TYPE_BOOLEAN
public
static mixed
$TYPE_BOOLEAN
= 'Boolean'
$TYPE_INTEGER
public
static mixed
$TYPE_INTEGER
= 'Integer'
$TYPE_NULL
public
static mixed
$TYPE_NULL
= 'Null'
$TYPE_SERIALIZABLE
public
static mixed
$TYPE_SERIALIZABLE
= 'Serializable'
$TYPE_STRING
public
static mixed
$TYPE_STRING
= 'String'
$appName
private
string
$appName
$contactsStore
private
IContactsStore
$contactsStore
$logger
private
ILogger
$logger
$userManager
private
IUserManager
$userManager
Methods
__construct()
public
__construct(ILogger $logger, IContactsStore $contactsStore, mixed $appName, IUserManager $userManager) : mixed
Parameters
- $logger : ILogger
- $contactsStore : IContactsStore
- $appName : mixed
- $userManager : IUserManager
Return values
mixed —asyncAndLeaveClientOutOfThis()
Hacky way to async the rest of the process without keeping client on hold.
public
asyncAndLeaveClientOutOfThis([string $result = '' ]) : mixed
Parameters
- $result : string = ''
Return values
mixed —e()
public
e(Exception $e) : mixed
Parameters
- $e : Exception
Return values
mixed —fail()
public
fail( $data) : DataResponse
Parameters
Return values
DataResponse —generateClientBodyData()
public
static generateClientBodyData([array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
- $options : array<string|int, mixed> = []
Return values
array<string|int, mixed> —get()
public
static get( $arr, $k[, string $default = '' ]) : array<string|int, mixed>|string
Parameters
Return values
array<string|int, mixed>|string —getContactData()
public
static getContactData( $ident) : mixed|string
Parameters
Tags
Return values
mixed|string —getContactDisplayName()
public
getContactDisplayName(string $ident) : string
Parameters
- $ident : string
Return values
string —getDisplay()
public
static getDisplay(string $ident, int $type) : string
Parameters
- $ident : string
- $type : int
Tags
Return values
string —getDisplayName()
return Display Name if user exists and display name exists.
public
getDisplayName( $userId[, bool $noException = false ]) : string
returns Exception if user does not exist.
However, with noException set to true, will return userId even if user does not exist
Parameters
Tags
Return values
string —getInfosFromContact()
public
getInfosFromContact(DeprecatedMember $member) : array<string|int, mixed>
Parameters
- $member : DeprecatedMember
Return values
array<string|int, mixed> —getRealUserId()
return the real userId, with its real case
public
getRealUserId( $userId) : string
Parameters
Tags
Return values
string —log()
public
log(mixed $message[, mixed $level = 4 ]) : mixed
Parameters
- $message : mixed
- $level : mixed = 4
Return values
mixed —mustContains()
public
static mustContains(mixed $data, mixed $arr) : mixed
Parameters
- $data : mixed
- $arr : mixed
Return values
mixed —success()
public
success( $data) : DataResponse
Parameters
Return values
DataResponse —token()
Generate uuid: 2b5a7a87-8db1-445f-a17b-405790f91c80
public
token(int $length) : string
Parameters
- $length : int
Return values
string —typeOf()
public
typeOf(string $key, array<string|int, mixed> $arr[, bool $root = true ]) : string
Parameters
- $key : string
- $arr : array<string|int, mixed>
- $root : bool = true
Tags
Return values
string —validKey()
public
validKey(string $k, array<string|int, mixed> $arr) : bool
Parameters
- $k : string
- $arr : array<string|int, mixed>
Return values
bool —cleanArray()
protected
cleanArray(array<string|int, mixed> &$arr) : mixed
Parameters
- $arr : array<string|int, mixed>
Return values
mixed —extractArray()
protected
extractArray(string $k, string $value, array<string|int, mixed> $list) : mixed
Parameters
- $k : string
- $value : string
- $list : array<string|int, mixed>
Tags
Return values
mixed —getArray()
protected
getArray(string $k, array<string|int, mixed> $arr[, array<string|int, mixed> $default = [] ]) : array<string|int, mixed>
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : array<string|int, mixed> = []
Return values
array<string|int, mixed> —getBool()
protected
getBool(string $k, array<string|int, mixed> $arr[, bool $default = false ]) : bool
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : bool = false
Return values
bool —getFloat()
protected
getFloat(string $k, array<string|int, mixed> $arr, float $default) : float
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : float
Return values
float —getInt()
protected
getInt(string $k, array<string|int, mixed> $arr, int $default) : int
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : int
Return values
int —getList()
protected
getList(string $k, array<string|int, mixed> $arr, array<string|int, mixed> $import[, array<string|int, mixed> $default = [] ]) : array<string|int, mixed>
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $import : array<string|int, mixed>
- $default : array<string|int, mixed> = []
Return values
array<string|int, mixed> —getObj()
protected
getObj(string $k, array<string|int, mixed> $arr[, JsonSerializable|null $default = null ]) : mixed
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : JsonSerializable|null = null
Return values
mixed —getDisplayContact()
private
static getDisplayContact(string &$display, string $ident, int $type) : mixed
Parameters
- $display : string
- $ident : string
- $type : int
Return values
mixed —getDisplayContactFromArray()
private
static getDisplayContactFromArray(string &$display, array<string|int, mixed> $contact) : mixed
Parameters
- $display : string
- $contact : array<string|int, mixed>
Tags
Return values
mixed —getDisplayMember()
private
static getDisplayMember(string &$display, string $ident, int $type) : mixed
Parameters
- $display : string
- $ident : string
- $type : int