\Drupal\strata\Branch BranchIndex

A local index over the branches in the object store.

Listing branches from the bucket costs one listing plus one GET per branch for the metadata and one more for the ref, so a page that shows a dozen branches would spend two dozen requests on a question the site already knows the answer to. This is that answer in a table.

Nothing here is authoritative. Every column is a field of a branches/ object or a ref that already exists, which is what makes it safe for an uninstall to drop the table and for strata:reindex to rebuild it.

Summary

Methods
Properties
Constants
__construct
record
get
all
count
forget
clear
No public properties found
TABLE
No protected methods found
No protected properties found
No protected constants found
No private methods found
database
No private constants found

Constant

TABLE

TABLE = 'strata_branch'

The table this index lives in.

Properties

$database

$database : \Drupal\Core\Database\Connection

Type

Connection

Methods

__construct()

__construct(\Drupal\Core\Database\Connection  $database) : mixed

Constructs an index.

Parameters

\Drupal\Core\Database\Connection $database

The database.

Returns

mixed —

record()

record(\Drupal\strata\Branch\Branch  $branch) : void

Records a branch, or updates the row for one already present.

Parameters

\Drupal\strata\Branch\Branch $branch

The branch.

Returns

void —

get()

get(string  $name) : array<string,mixed>|null

The row for one branch.

Parameters

string $name

The branch name.

Returns

array|null —

The row, or NULL when the branch is not indexed.

all()

all() : list<array<string,mixed>>

Every indexed branch, newest first.

Returns

list> —

The rows.

count()

count() : int

How many branches are indexed.

Returns

int —

The count.

forget()

forget(string  $name) : int

Removes the row for one branch.

Parameters

string $name

The branch name.

Returns

int —

How many rows were removed.

clear()

clear() : int

Drops every row.

Returns

int —

How many rows were removed.