class revision_diff implements JsonSerializable

Value Object: Revision Diff.

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

Methods

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

No description

static revision_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.

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

revision_diff

at line 60
bool has_changed()

Checks if there was an actual change.

Return Value

bool

at line 70
array to_array()

Export the diff as associative array.

Return Value

array

at line 84
array jsonSerialize()

Serialize to JSON representation.

Return Value

array