final class ChangeRequestPresenter (View source)

Shapes change requests for the list, review and edit-page templates.

Constants

private FIELDS

Methods

static array
summary(ZoneChangeRequest $request, int|null $now = null)

One row of a request listing.

static array
summaries(array $requests, int|null $now = null)

No description

static array
actions(ZoneChangeRequest $request, array $staleIndexes)

The request's actions as before/after rows with the differing fields named.

static array
changedFields(array|null $before, array|null $after)

Fields whose value differs between the two snapshots. The stored "before" carries booleans and the posted "after" integers, so values compare as text.

static string
age(string $createdAt, int|null $now = null)

Rough age of a timestamp in words, for listings where the exact time is a tooltip.

Details

static array summary(ZoneChangeRequest $request, int|null $now = null)

One row of a request listing.

Parameters

ZoneChangeRequest $request
int|null $now

Return Value

array

static array summaries(array $requests, int|null $now = null)

No description

Parameters

array $requests
int|null $now

Return Value

array

static array actions(ZoneChangeRequest $request, array $staleIndexes)

The request's actions as before/after rows with the differing fields named.

Parameters

ZoneChangeRequest $request
array $staleIndexes

Actions the zone has moved away from

Return Value

array

static array changedFields(array|null $before, array|null $after)

Fields whose value differs between the two snapshots. The stored "before" carries booleans and the posted "after" integers, so values compare as text.

Parameters

array|null $before
array|null $after

Return Value

array

static string age(string $createdAt, int|null $now = null)

Rough age of a timestamp in words, for listings where the exact time is a tooltip.

Parameters

string $createdAt
int|null $now

Return Value

string