\Drupal\strata\Restore RestoreResult

What a restore actually did, against what it planned to.

Separate from the plan because the two disagree in exactly the cases that matter. A subject that planned as restorable and then failed to write - a validation constraint, a missing bundle, a field that no longer exists - is the interesting half of a restore, and folding it back into the plan would hide it.

Summary

Methods
Properties
Constants
__construct
refuse
wasRefused
outcome
summary
jsonSerialize
target
snapshot
restored
skipped
failed
refused
seconds
No public constants found
No protected methods found
No protected properties found
No protected constants found
No private methods found
No private properties found
No private constants found

Properties

$target

$target : string

Type

string

$snapshot

$snapshot : ?string

Type

string|null

$restored

$restored : array

Type

array<string|int, mixed>

$skipped

$skipped : array

Type

array<string|int, mixed>

$failed

$failed : array

Type

array<string|int, mixed>

$refused

$refused : ?string

Type

string|null

$seconds

$seconds : float

Type

float

Methods

__construct()

__construct(string  $target, string|null  $snapshot = null, list  $restored = [], array  $skipped = [], array  $failed = [], string|null  $refused = null, float  $seconds = 0.0) : mixed

Constructs a result.

Parameters

string $target

Commit the restore targeted.

string|null $snapshot

Commit taken before the restore, so it can be undone, or NULL when none was taken.

list $restored

Subject paths written back.

array $skipped

Subject path keyed to why it was left alone.

array $failed

Subject path keyed to why writing it did not work.

string|null $refused

Why the restore did not start, or NULL when it ran.

float $seconds

How long it took.

Returns

mixed —

refuse()

refuse(string  $target, string  $reason) : self

A result for a restore that declined to start.

Parameters

string $target

Commit it would have targeted.

string $reason

Why it refused.

Returns

self —

The result.

wasRefused()

wasRefused() : bool

Whether the restore declined to start.

Returns

bool —

TRUE when it refused.

outcome()

outcome() : string

The outcome an audit row records.

A restore with any failed subject is FAILED even when most of it worked, because a partly applied rollback is a state the operator has to know about and "succeeded with notes" is not a state anyone reads.

Returns

string —

One of the RestoreAudit outcome constants.

summary()

summary() : string

A one-line summary for a log entry or a command's output.

Returns

string —

The summary.

jsonSerialize()

jsonSerialize() : array<string,mixed>

{@inheritdoc}

Returns

array

The result as a plain array, which is the form the audit log keeps.