API Services TupleFilterServiceInterface - evansims/openfga-php GitHub Wiki
Service for filtering and deduplicating tuple operations. This service encapsulates the business logic for handling duplicate tuples in write and delete operations, ensuring that: - No duplicate tuples exist within writes or deletes - Delete operations take precedence over writes when conflicts occur - Order is preserved based on first occurrence
Table of Contents
OpenFGA\Services
- TupleFilterService (implementation)
public function filterDuplicates(TupleKeysInterface|null $writes, TupleKeysInterface|null $deletes): array
Filter duplicate tuples from writes and deletes collections. This method ensures that: 1. No duplicate tuples exist within the writes collection 2. No duplicate tuples exist within the deletes collection 3. If a tuple appears in both writes and deletes, it's removed from writes (delete takes precedence to ensure the final state is deletion)
Name | Type | Description |
---|---|---|
$writes |
TupleKeysInterface | null
|
The writes to filter |
$deletes |
TupleKeysInterface | null
|
The deletes to filter |
array