Manager
Table of Contents
Methods
- __construct() : mixed
- clearHistoryByContext() : void
- Removes all History by Context.
- deleteForUser() : void
- Finally removes all records for the user.
- getCapacity() : int
- Returns capacity of history per user-context.
- getFakeItem() : Item
- Returns fake History Item (use when history doesn't exist for current user).
- getLastItem() : array<string|int, mixed>|null
- Returns last history item for current context.
- readHistory() : Collection
- Returns collection of history Items.
- shouldAlwaysWrite() : bool
- Returns true, if in module settings enabled corresponding option.
- shouldDisableHistoryForUser() : bool
- Returns true if history will not be saved for current user.
- writeHistory() : bool
- Writes history for Engine's work result.
Methods
__construct()
public
__construct(IEngine $engine) : mixed
Parameters
- $engine : IEngine
clearHistoryByContext()
Removes all History by Context.
public
static clearHistoryByContext(array<string|int, mixed>|string $context) : void
Parameters
- $context : array<string|int, mixed>|string
-
Specified context.
deleteForUser()
Finally removes all records for the user.
public
static deleteForUser(int $userId) : void
Parameters
- $userId : int
-
User id.
getCapacity()
Returns capacity of history per user-context.
public
static getCapacity() : int
Return values
intgetFakeItem()
Returns fake History Item (use when history doesn't exist for current user).
public
static getFakeItem(string|null $data, IEngine|Engine $engine) : Item
Parameters
- $data : string|null
-
Data.
- $engine : IEngine|Engine
-
Engine instance.
Return values
ItemgetLastItem()
Returns last history item for current context.
public
static getLastItem(Context $context) : array<string|int, mixed>|null
Parameters
- $context : Context
-
Context instance.
Return values
array<string|int, mixed>|nullreadHistory()
Returns collection of history Items.
public
static readHistory(Context $context[, int|null $limit = 0 ]) : Collection
Parameters
- $context : Context
-
History context.
- $limit : int|null = 0
-
Limit of records.
Return values
CollectionshouldAlwaysWrite()
Returns true, if in module settings enabled corresponding option.
public
static shouldAlwaysWrite() : bool
Return values
boolshouldDisableHistoryForUser()
Returns true if history will not be saved for current user.
public
static shouldDisableHistoryForUser(int $userId) : bool
Parameters
- $userId : int
Return values
boolwriteHistory()
Writes history for Engine's work result.
public
writeHistory(Result $result) : bool
Parameters
- $result : Result
-
Result data.