This documentation describes unreleased changes on the main branch.

#[Indexed]

Attribute on parameters, repeatable.

use Saij\WpAppFramework\Table\Indexed;

Adds the column to an index. Without a group, the column gets an index of its own, named after the column; with a group, it is part of the index called like the group, at its position (1, 2, …). Repeat the attribute to put a column into several indexes.

Arguments

#[Indexed(?string $group = null, ?int $position = null, bool $unique = false)]
ParameterTypeDefaultDescription
groupstring|nullnullName of an index of several columns.
positionint|nullnullPosition of the column in the group, required with a group.
uniqueboolfalseNo two rows with the same values (the same for every column of a group).