class OwnerOptionsPresenter (View source)

Which users a zone-owner picker offers, and which one it shows again after a refused submit. Whether the caller may pick other users is decided by the permission layer and passed in.

Methods

static array
offered(bool $everyone, array $users, int|null $userId)

No description

static int|string
preservedChoice(array $assignableOwners, mixed $ownerInput, int|null $userId)

The owner an add-zone form shows again after a failed submit: the posted id when the picker can offer it, '' for an explicit "no user owner", otherwise the current user.

Details

static array offered(bool $everyone, array $users, int|null $userId)

No description

Parameters

bool $everyone

Whether the caller may pick users other than themselves

array $users

Rows with an 'id' key

int|null $userId

Return Value

array

static int|string preservedChoice(array $assignableOwners, mixed $ownerInput, int|null $userId)

The owner an add-zone form shows again after a failed submit: the posted id when the picker can offer it, '' for an explicit "no user owner", otherwise the current user.

Parameters

array $assignableOwners
mixed $ownerInput

The raw posted value, if any

int|null $userId

Return Value

int|string