Documentation

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

$connectionIpId read-only

private int $connectionIpId

$serverId read-only

private int $serverId

$tableName read-only

private string $tableName = 'system_events'

Methods

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|null

now()

private now() : DateTimeImmutable
Return values
DateTimeImmutable

verifyData()

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
On this page

Search results