\Drupal\strata\Form RetentionSettingsForm

How long history is kept, how often it is anchored, and what happens at the spend ceiling.

The base interval is a restore-latency dial, not a storage dial, and the form says so. An earlier model had it as the largest lever on stored bytes; measuring it showed the two effects largely cancel, because a longer interval means fewer anchors that each record more changed subjects. What it really controls is how many segments a replay walks to reach a given moment.

The retention ladder is rendered as a table of levels rather than as free-form configuration, because a level whose window is wider than the level above it produces a rollup that folds backwards. The validation refuses that rather than letting a cron run discover it.

Summary

Methods
Properties
Constants
getFormId
buildForm
validateForm
submitForm
create
No public properties found
LEVELS
SETTINGS
settingKeys
getEditableConfigNames
fieldFor
setting
coerce
engine
No protected constants found
addAnchors
addLadder
addBudget
addHealing
No private properties found
No private constants found

Constant

LEVELS

LEVELS = 5

Levels the form renders.

SETTINGS

SETTINGS = 'strata.settings'

The configuration object every settings form edits.

Properties

$engine

$engine : ?\Drupal\strata\Engine

The engine, reset after a save.

Type

Engine|null

Methods

getFormId()

getFormId() : string

{@inheritdoc}

Returns

string —

buildForm()

buildForm(array  $form, \Drupal\Core\Form\FormStateInterface  $form_state) : array

{@inheritdoc}

Parameters

array $form
\Drupal\Core\Form\FormStateInterface $form_state

Returns

array —

validateForm()

validateForm(array  $form, \Drupal\Core\Form\FormStateInterface  $form_state) : void

{@inheritdoc}

Parameters

array $form
\Drupal\Core\Form\FormStateInterface $form_state

Returns

void —

submitForm()

submitForm(array  $form, \Drupal\Core\Form\FormStateInterface  $form_state) : void

{@inheritdoc}

Parameters

array $form
\Drupal\Core\Form\FormStateInterface $form_state

Returns

void —

create()

create(\Symfony\Component\DependencyInjection\ContainerInterface  $container) : static

{@inheritdoc}

The engine is asked for, never required. composer.json PSR-4 maps Drupal\strata\ onto src/, so every class here loads off composer's autoloader whether or not the module is in core.extension, while strata.services.yml reaches the container only when it is. A router table still holding this route after the module left - a failed install, a composer remove with no uninstall - therefore resolves the class, calls this, and answered 500 with ServiceNotFoundException until 1.0.3. The property is nullable and every use of it is null-safe, so asking is the whole fix.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container

Returns

static —

settingKeys()

settingKeys() : array<string,string>

The settings this form owns, keyed to their type.

Returns

array

Dotted config key keyed to one of "string", "int", "float" or "bool".

getEditableConfigNames()

getEditableConfigNames() : list<string>

{@inheritdoc}

Returns

list

The configuration this form edits.

fieldFor()

fieldFor(string  $key) : string

The form field a config key is edited by.

Dots are not valid in a form element name, so a nested key is rendered under a flattened one.

Parameters

string $key

The dotted config key.

Returns

string —

The form field name.

setting()

setting(string  $key, mixed  $default = null) : mixed

One current setting.

Parameters

string $key

The dotted config key.

mixed $default

What to return when nothing is configured.

Returns

mixed —

The configured value.

coerce()

coerce(mixed  $value, string  $type) : mixed

Coerces a submitted value to the type the config schema declares.

A form always submits strings, and configuration is schema-validated on save, so an integer setting handed the string "15" fails validation on a site running strictConfigSchema.

Parameters

mixed $value

The submitted value.

string $type

One of "string", "int", "float" or "bool".

Returns

mixed —

The coerced value.

addAnchors()

addAnchors(array  $form) : void

The anchor interval.

Parameters

array $form

The form, added to by reference.

Returns

void —

addLadder()

addLadder(array  $form) : void

The retention ladder.

Parameters

array $form

The form, added to by reference.

Returns

void —

addBudget()

addBudget(array  $form) : void

The spend ceiling.

Parameters

array $form

The form, added to by reference.

Returns

void —

addHealing()

addHealing(array  $form) : void

The self-healing policy.

Parameters

array $form

The form, added to by reference.

Returns

void —