audit_diff
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
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.
at line 60
bool
has_changed()
Checks if there was an actual change.
at line 65
string
get_field_name()
No description
at line 70
string|null
get_old_value()
No description
at line 75
string|null
get_new_value()
No description
at line 85
array
to_array()
Export the diff as associative array.
at line 99
array
jsonSerialize()
Serialize to JSON representation.