\Drupal\strata\Hook ViewsData

Exposes every table Strata writes to Views.

The reason to do this rather than build bespoke report pages: an operator's questions about a backup are not knowable in advance. "Which commits did this user cause last Tuesday", "which frames have one reference and are over a megabyte", "which restores were refused and why" - each of those is a view somebody can build in a minute and none of them is worth a controller.

Relationships are declared where they are real. A commit's parent is a commit, an operation belongs to a commit, a frame belongs to a pack. Declaring those lets a view join them; not declaring them would leave an operator with ten unrelated tables and no way to ask a question that spans two.

The payload columns are exposed but not rendered by default. A journal payload is the captured value itself, which is exactly the thing view strata payloads gates, so a view that shows it needs that permission and the default views do not include it.

Summary

Methods
Properties
Constants
tables
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
journal
commits
subjects
frames
dictionaries
restores
health
classifications
table
text
numeric
bytes
boolean
digest
commitId
microtime
actor
realm
verb
severity
classification
No private properties found
No private constants found

Methods

tables()

tables() : array<string,mixed>

Declares Strata's tables and how they join.

Returns

array

Views data, keyed by table name.

journal()

journal() : array<string,mixed>

The journal: operations captured and not yet sealed.

Returns

array

Views data for the table.

commits()

commits() : array<string,mixed>

The commit index: one row per point in history.

Returns

array

Views data for the table.

subjects()

subjects() : array<string,mixed>

The subject index: where each subject was last stored.

Returns

array

Views data for the table.

frames()

frames() : array<string,mixed>

The frame index: one row per stored frame.

Returns

array

Views data for the table.

dictionaries()

dictionaries() : array<string,mixed>

The dictionary index.

Returns

array

Views data for the table.

restores()

restores() : array<string,mixed>

The restore audit.

Returns

array

Views data for the table.

health()

health() : array<string,mixed>

The health ledger.

Returns

array

Views data for the table.

classifications()

classifications() : array<string,mixed>

The classification registry.

Returns

array

Views data for the table.

table()

table(string  $table, string|object  $title, string|object  $help, string  $field) : array<string,mixed>

The table declaration every one of these shares.

Parameters

string $table

The table name.

string|object $title

Human title.

string|object $help

What the table holds.

string $field

The column a view uses as its base field.

Returns

array

The opening of a views data array.

text()

text(string|object  $title, string|object  $help) : array<string,mixed>

A plain string column.

Parameters

string|object $title

Human title.

string|object $help

What the column holds.

Returns

array

The column declaration.

numeric()

numeric(string|object  $title, string|object  $help) : array<string,mixed>

A plain number column.

Parameters

string|object $title

Human title.

string|object $help

What the column holds.

Returns

array

The column declaration.

bytes()

bytes(string|object  $title, string|object  $help) : array<string,mixed>

A byte count, rendered in the largest unit that stays readable.

Parameters

string|object $title

Human title.

string|object $help

What the column holds.

Returns

array

The column declaration.

boolean()

boolean(string|object  $title, string|object  $help) : array<string,mixed>

A boolean column.

Parameters

string|object $title

Human title.

string|object $help

What the column holds.

Returns

array

The column declaration.

digest()

digest(string|object  $title) : array<string,mixed>

A content address, shown abbreviated.

Parameters

string|object $title

Human title.

Returns

array

The column declaration.

commitId()

commitId(string|object  $title) : array<string,mixed>

A commit id, which links to the commit.

Parameters

string|object $title

Human title.

Returns

array

The column declaration.

microtime()

microtime(string|object  $title) : array<string,mixed>

Unix microseconds, rendered as a date.

Parameters

string|object $title

Human title.

Returns

array

The column declaration.

actor()

actor() : array<string,mixed>

A user id, joined to the user entity so a view can show the account.

Returns

array

The column declaration.

realm()

realm() : array<string,mixed>

The realm column, filtered by the realms that exist.

Returns

array

The column declaration.

verb()

verb() : array<string,mixed>

The verb column, filtered by the verbs that exist.

Returns

array

The column declaration.

severity()

severity() : array<string,mixed>

The severity column, filtered by the severities that exist.

Returns

array

The column declaration.

classification()

classification() : array<string,mixed>

The classification column, filtered by the classifications that exist.

Returns

array

The column declaration.