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


Namespace

OpenFGA\Services


Source

View source code


Implements


Related Classes


Methods

filterDuplicates

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)

View source


Parameters

Name Type Description
$writes TupleKeysInterface | null The writes to filter
$deletes TupleKeysInterface | null The deletes to filter

Returns

array

⚠️ **GitHub.com Fallback** ⚠️