\Drupal\strata\Restore ReplayResult

One subject as it stood at a moment in history.

A replay produces a field set rather than an entity, because writing it back is a separate decision with its own permissions and its own failure modes. The result also carries what it could NOT read, so a caller can tell a complete reconstruction from a partial one without guessing from the field count.

Summary

Methods
Properties
Constants
__construct
absent
isComplete
wasFound
status
jsonSerialize
subject
exists
fields
versions
depth
unreadable
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

$subject

$subject : string

Type

string

$exists

$exists : bool

Type

bool

$fields

$fields : array

Type

array<string|int, mixed>

$versions

$versions : int

Type

int

$depth

$depth : int

Type

int

$unreadable

$unreadable : array

Type

array<string|int, mixed>

Methods

__construct()

__construct(string  $subject, bool  $exists = true, array  $fields = [], int  $versions = 0, int  $depth = 0, list  $unreadable = []) : mixed

Constructs a result.

Parameters

string $subject

The subject path, such as "entity/node:42".

bool $exists

FALSE when the last operation in range deleted the subject, so restoring it means removing whatever is there now rather than writing fields.

array $fields

Field name keyed to its value at the target, merged oldest change first.

int $versions

How many stored changes were applied.

int $depth

How many commits the walk covered.

list $unreadable

One line per version that could not be read, naming the commit and the reason.

Returns

mixed —

absent()

absent(string  $subject, int  $depth = 0) : self

A result for a subject history does not mention.

Parameters

string $subject

The subject path.

int $depth

How many commits were searched.

Returns

self —

An empty result.

isComplete()

isComplete() : bool

Whether every version the walk needed was readable.

Returns

bool —

TRUE when nothing was missed.

wasFound()

wasFound() : bool

Whether the walk found any stored change for this subject.

Returns

bool —

TRUE when at least one version was applied or one was found and could not be read.

status()

status() : \Drupal\strata\Restore\SubjectStatus

How completely this subject can be put back.

Returns

\Drupal\strata\Restore\SubjectStatus —

The classification a preflight reports.

jsonSerialize()

jsonSerialize() : array<string,mixed>

{@inheritdoc}

Returns

array

The result as a plain array.