API Responses WriteTuplesResponseInterface - evansims/openfga-php GitHub Wiki

Interface for tuple writing response objects. This interface defines the contract for responses returned when writing relationship tuples to an OpenFGA store. The response handles both transactional and non-transactional write modes, providing appropriate feedback for each operation type. In transactional mode, all changes succeed or fail together. In non-transactional mode, operations are processed independently with detailed success/failure tracking.

Table of Contents


Namespace

OpenFGA\Responses


Source

View source code


Implements


Related Classes


Methods

getErrors

public function getErrors(): array<Throwable>

Get all errors that occurred during processing.

View source


Returns

array&lt;Throwable&gt; — Array of exceptions from failed operations


getFailedChunks

public function getFailedChunks(): int

Get the number of failed chunks.

View source


Returns

int — The number of failed chunks


getFirstError

public function getFirstError(): Throwable|null

Get the first error that occurred.

View source


Returns

Throwable | null — The first error, or null if no errors


getSuccessRate

public function getSuccessRate(): float

Calculate the success rate of the operation.

View source


Returns

float — Success rate between 0.0 and 1.0


getSuccessfulChunks

public function getSuccessfulChunks(): int

Get the number of successfully processed chunks.

View source


Returns

int — The number of successful chunks


getTotalChunks

public function getTotalChunks(): int

Get the total number of chunks processed (non-transactional mode).

View source


Returns

int — The number of chunks, or 1 for transactional mode


getTotalOperations

public function getTotalOperations(): int

Get the total number of tuple operations processed.

View source


Returns

int — The total number of write and delete operations


isCompleteFailure

public function isCompleteFailure(): bool

Check if all operations failed.

View source


Returns

bool — True if all operations failed


isCompleteSuccess

public function isCompleteSuccess(): bool

Check if all operations completed successfully.

View source


Returns

bool — True if all operations succeeded


isPartialSuccess

public function isPartialSuccess(): bool

Check if some operations succeeded and some failed.

View source


Returns

bool — True if partial success (non-transactional mode only)


isTransactional

public function isTransactional(): bool

Check if the operation was executed in transactional mode.

View source


Returns

bool — True if transactional, false if non-transactional


throwOnFailure

public function throwOnFailure(): void

Throw an exception if any operations failed.

View source


Returns

void

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