RecordChangeLogger
class RecordChangeLogger (View source)
Constants
| ACTION_RECORD_CREATE |
|
| ACTION_RECORD_EDIT |
|
| ACTION_RECORD_DELETE |
|
| ACTION_ZONE_CREATE |
|
| ACTION_ZONE_DELETE |
|
| ACTION_ZONE_METADATA_EDIT |
|
| private MAX_FIELD_LENGTH |
|
| private MAX_SNAPSHOT_LENGTH |
|
| private MAX_COMMENT_LENGTH |
|
Methods
No description
Run $work with every change it logs grouped under one changeset carrying the given reason. Pass $zoneId only when the whole scope belongs to one zone; a cross-zone submission leaves it null and the per-change rows carry the truth.
Open a changeset scope. Every change logged until the matching endChangeset() is grouped under one row carrying the reason for the change. Nested calls join the outermost scope so a controller can wrap a service that also wraps.
No description
No description
Drops any open scope. Tests only - the static state would otherwise leak between them.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Details
__construct(PDO $db, UserContextService|null $userContext = null, ConfigurationManager|null $config = null)
No description
static mixed
withChangeset(int|null $zoneId, string|null $comment, callable $work)
Run $work with every change it logs grouped under one changeset carrying the given reason. Pass $zoneId only when the whole scope belongs to one zone; a cross-zone submission leaves it null and the per-change rows carry the truth.
static void
beginChangeset(int|null $zoneId = null, string|null $comment = null)
Open a changeset scope. Every change logged until the matching endChangeset() is grouped under one row carrying the reason for the change. Nested calls join the outermost scope so a controller can wrap a service that also wraps.
Prefer withChangeset(), which cannot leave a scope open if $work throws.
static void
endChangeset()
No description
static bool
changeCommentRequired()
No description
static void
resetChangesetScope()
Drops any open scope. Tests only - the static state would otherwise leak between them.
void
logRecordCreate(array $afterRecord, int|null $zoneId)
No description
void
logRecordEdit(array $beforeRecord, array $afterRecord, int $zoneId)
No description
void
logRecordDelete(array $beforeRecord, int|null $zoneId)
No description
void
logZoneCreate(array $zoneData)
No description
void
logZoneDelete(array $zoneData, int $recordCount)
No description
void
logZoneMetadataEdit(array $beforeZone, array $afterZone)
No description
static array
normalizeMetadataRows(array $rows)
No description
int
countFiltered(array $filters)
No description
array
getFiltered(array $filters, int $limit, int $offset)
No description
array
getDistinctActions()
No description
array
getDistinctUsers()
No description