API Models TupleChangeInterface - evansims/openfga-php GitHub Wiki
Represents a change event for a relationship tuple in OpenFGA. Tuple changes capture the history of relationship modifications in the authorization store. Each change records whether a tuple was written (created) or deleted, along with the timestamp and the specific tuple that was affected. These change events are essential for: - Auditing relationship modifications - Implementing consistency across distributed systems - Debugging authorization issues - Maintaining change history for compliance
Table of Contents
OpenFGA\Models
ModelInterface
JsonSerializable
- TupleChange (implementation)
public function getOperation(): TupleOperation
Get the type of operation performed on the tuple. Operations indicate whether the tuple was written (created) or deleted from the authorization store. This information is crucial for understanding the nature of the change.
TupleOperation
— The operation type (write or delete)
public function getTimestamp(): DateTimeImmutable
Get the timestamp when this tuple change occurred. Timestamps help track the chronological order of changes and provide audit trail capabilities. They are essential for understanding the sequence of relationship modifications.
DateTimeImmutable
— The change timestamp
public function getTupleKey(): TupleKeyInterface
Get the tuple key that was affected by this change. The tuple key identifies which specific relationship was created or deleted, containing the user, relation, object, and optional condition information.
TupleKeyInterface
— The tuple key that was modified
public function jsonSerialize(): array<string, mixed>
array<
string,
mixed>