LocalizationResult

final readonly class \TYPO3\CMS\Backend\Localization\LocalizationResult

Implements
JsonSerializable

Result object for localization operations

Contains the outcome of a localization operation and optional finisher that tells the frontend what to do next (e.g., redirect, load a module, reload).

Table of Contents

Interfaces

JsonSerializable

Properties

$errors  : array
$finisher  : LocalizationFinisherInterface|null
$success  : bool

Methods

__construct()  : mixed
error()  : self
Create a failed result with error messages
hasErrors()  : bool
Check if the result has errors
isSuccess()  : bool
Check if the result is successful
jsonSerialize()  : array
Convert to array for JSON serialization
success()  : self
Create a successful result

Properties

Methods

__construct()

public __construct([bool $success = true ][, LocalizationFinisherInterface|null $finisher = null ][, string[] $errors = [] ]) : mixed

Parameters

$success : bool = true

Whether the localization was successful

$finisher : LocalizationFinisherInterface|null = null

Finisher to execute after localization (required for success)

$errors : string[] = []

Array of error messages (if any)

error()

Create a failed result with error messages

public static error(string[] $errors) : self

Parameters

$errors : string[]

Return values

self

hasErrors()

Check if the result has errors

public hasErrors() : bool

Return values

bool

isSuccess()

Check if the result is successful

public isSuccess() : bool

Return values

bool

jsonSerialize()

Convert to array for JSON serialization

public jsonSerialize() : array

Return values

array
On this page