LocalizationResult implements JsonSerializable

Read onlyYes
FinalYes

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).

Internal

Table of Contents

Interfaces

JsonSerializable

Properties

$errors  : array<string|int, mixed>
$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<string|int, mixed>
Convert to array for JSON serialization
success()  : self
Create a successful result

Properties

$errors

public array<string|int, mixed> $errors = []

Methods

__construct()

public __construct([bool $success = true ][, LocalizationFinisherInterface|null $finisher = null ][, array<string|int, 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 : array<string|int, string> = []

Array of error messages (if any)

error()

Create a failed result with error messages

public static error(array<string|int, string> $errors) : self
Parameters
$errors : array<string|int, 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<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results