class audit_diff implements audit_diff_interface, JsonSerializable

Value Object: Audit Diff.

Represents a single field change (old vs new value). Corresponds to a row in middag_audit_diff.

Methods

__construct(string $field_name, string|null $old_value, string|null $new_value)

No description

static audit_diff
from_state(string $field, mixed $old, mixed $new)

Creates a diff instance from raw database values or entity properties.

bool
has_changed()

Checks if there was an actual change.

string
get_field_name()

No description

string|null
get_old_value()

No description

string|null
get_new_value()

No description

array
to_array()

Export the diff as associative array.

array
jsonSerialize()

Serialize to JSON representation.

Details

at line 30
__construct(string $field_name, string|null $old_value, string|null $new_value)

No description

Parameters

string $field_name
string|null $old_value
string|null $new_value

at line 46
static audit_diff from_state(string $field, mixed $old, mixed $new)

Creates a diff instance from raw database values or entity properties.

Handles type conversion safely.

Parameters

string $field
mixed $old
mixed $new

Return Value

audit_diff

at line 60
bool has_changed()

Checks if there was an actual change.

Return Value

bool

at line 65
string get_field_name()

No description

Return Value

string

at line 70
string|null get_old_value()

No description

Return Value

string|null

at line 75
string|null get_new_value()

No description

Return Value

string|null

at line 85
array to_array()

Export the diff as associative array.

Return Value

array

at line 99
array jsonSerialize()

Serialize to JSON representation.

Return Value

array