MultiSelectEnumSchemaDefinition extends AbstractSchemaDefinition
FinalYes
Schema definition for multi-select enum fields without titles (SEP-1330).
Produces: {"type": "array", "items": {"type": "string", "enum": [...]}}
Tags
Table of Contents
Properties
- $default : array<string|int, mixed>|null
- $description : string|null
- $enum : array<string|int, mixed>
- $maxItems : int|null
- $minItems : int|null
- $title : string
Methods
- __construct() : mixed
- fromArray() : self
- jsonSerialize() : array<string, mixed>
- buildBaseJson() : array<string, mixed>
- Build the base JSON structure with type, title, and optional description.
- validateTitle() : void
- Validate that title exists and is a string in the data array.
Properties
$default read-only
public
array<string|int, mixed>|null
$default
= null
$description read-only
public
string|null
$description
= null
$enum read-only
public
array<string|int, mixed>
$enum
$maxItems read-only
public
int|null
$maxItems
= null
$minItems read-only
public
int|null
$minItems
= null
$title read-only
public
string
$title
Methods
__construct()
public
__construct(string $title, array<string|int, string> $enum[, string|null $description = null ][, array<string|int, string>|null $default = null ][, int|null $minItems = null ][, int|null $maxItems = null ]) : mixed
Parameters
- $title : string
-
Human-readable title for the field
- $enum : array<string|int, string>
-
Array of allowed string values
- $description : string|null = null
-
Optional description/help text
- $default : array<string|int, string>|null = null
-
Optional default selected values (must be subset of enum)
- $minItems : int|null = null
-
Optional minimum number of selections
- $maxItems : int|null = null
-
Optional maximum number of selections
fromArray()
public
static fromArray(array{title: string, items: array{type: string, enum: string[]}, description?: string, default?: string[], minItems?: int, maxItems?: int} $data) : self
Parameters
- $data : array{title: string, items: array{type: string, enum: string[]}, description?: string, default?: string[], minItems?: int, maxItems?: int}
Return values
selfjsonSerialize()
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>buildBaseJson()
Build the base JSON structure with type, title, and optional description.
protected
buildBaseJson(string $type) : array<string, mixed>
Parameters
- $type : string
Return values
array<string, mixed>validateTitle()
Validate that title exists and is a string in the data array.
protected
static validateTitle(array<string, mixed> $data, string $schemaType) : void
Parameters
- $data : array<string, mixed>
- $schemaType : string