LogEvent
in package
FinalYes
Table of Contents
Properties
- $account : bool
- $cache : SafetyDataStructureVariable
- $connectionIpId : int
- $database : Database
- $datetime : DateTime
- $idUser : int
- $log : T4LOG
- $serverId : int
- $tableName : string
Methods
- __construct() : mixed
- add() : int
- Adds an event to the database.
- attributesTypes() : array<string|int, mixed>
- Returns an array of column names mapped to their respective
- assertArray() : void
- assertId() : void
- assertName() : void
- assertUserId() : void
- dataStructure() : mixed
- encodeContext() : string|null
- now() : DateTimeImmutable
- verifyData() : void
Properties
$account read-only
private
bool
$account
$cache read-only
private
SafetyDataStructureVariable
$cache
$connectionIpId read-only
private
int
$connectionIpId
$database read-only
private
Database
$database
$datetime read-only
private
DateTime
$datetime
$idUser read-only
private
int
$idUser
$log read-only
private
T4LOG
$log
$serverId read-only
private
int
$serverId
$tableName read-only
private
string
$tableName
= 'system_events'
Methods
__construct()
public
__construct(Database $database, T4LOG $log, DateTime $datetime, SafetyDataStructureVariable $cache, bool $account, int $idUser, int $connectionIpId, int $serverId[, string $tableName = 'system_events' ]) : mixed
Parameters
- $database : Database
- $log : T4LOG
- $datetime : DateTime
- $cache : SafetyDataStructureVariable
- $account : bool
- $idUser : int
- $connectionIpId : int
- $serverId : int
- $tableName : string = 'system_events'
add()
Adds an event to the database.
public
add(string $entityType, int $eventTypeId, int $severityId, int $actorTypeId, string $description[, string|null $actorName = null ][, int|null $entityId = null ][, array<string|int, mixed>|null $newValues = null ][, array<string|int, mixed>|null $oldValues = null ][, array<string|int, mixed>|null $metadata = null ]) : int
Parameters
- $entityType : string
- $eventTypeId : int
- $severityId : int
- $actorTypeId : int
- $description : string
- $actorName : string|null = null
- $entityId : int|null = null
- $newValues : array<string|int, mixed>|null = null
- $oldValues : array<string|int, mixed>|null = null
- $metadata : array<string|int, mixed>|null = null
Return values
int —The inserted row ID.
attributesTypes()
Returns an array of column names mapped to their respective
protected
static attributesTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>assertArray()
private
assertArray(array<string|int, mixed>|null $array, string $eventName) : void
Parameters
- $array : array<string|int, mixed>|null
- $eventName : string
assertId()
private
assertId(int|null $number, string $eventName) : void
Parameters
- $number : int|null
- $eventName : string
assertName()
private
assertName(string|null $name, string $eventType) : void
Parameters
- $name : string|null
- $eventType : string
assertUserId()
private
assertUserId(int $userId) : void
Parameters
- $userId : int
dataStructure()
private
dataStructure(string $entityType, int $eventTypeId, int $severityId, int $actorTypeId, string $description[, string|null $actorName = null ][, int|null $entityId = null ][, array<string|int, mixed>|null $newValues = null ][, array<string|int, mixed>|null $oldValues = null ][, array<string|int, mixed>|null $metadata = null ]) : mixed
Parameters
- $entityType : string
- $eventTypeId : int
- $severityId : int
- $actorTypeId : int
- $description : string
- $actorName : string|null = null
- $entityId : int|null = null
- $newValues : array<string|int, mixed>|null = null
- $oldValues : array<string|int, mixed>|null = null
- $metadata : array<string|int, mixed>|null = null
encodeContext()
private
encodeContext(array<string, mixed> $context) : string|null
Parameters
- $context : array<string, mixed>
Return values
string|nullnow()
private
now() : DateTimeImmutable
Return values
DateTimeImmutableverifyData()
private
verifyData(string $entityType, int $eventTypeId, int $severityId, int $actorTypeId, string $description[, string|null $actorName = null ][, int|null $entityId = null ][, array<string|int, mixed>|null $newValues = null ][, array<string|int, mixed>|null $oldValues = null ][, array<string|int, mixed>|null $metadata = null ]) : void
Parameters
- $entityType : string
- $eventTypeId : int
- $severityId : int
- $actorTypeId : int
- $description : string
- $actorName : string|null = null
- $entityId : int|null = null
- $newValues : array<string|int, mixed>|null = null
- $oldValues : array<string|int, mixed>|null = null
- $metadata : array<string|int, mixed>|null = null