API Services TupleFilterService - evansims/openfga-php GitHub Wiki
Default implementation of TupleFilterServiceInterface. Provides efficient duplicate filtering for tuple operations using hash-based lookups to ensure O(n) complexity.
Table of Contents
OpenFGA\Services
- TupleFilterServiceInterface (interface)
public function filterDuplicates(
?OpenFGA\Models\Collections\TupleKeysInterface $writes,
?OpenFGA\Models\Collections\TupleKeysInterface $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