{"$schema":"https://yii2-framework.github.io/docs/reference/reference.schema.json","schemaVersion":1,"package":"form-model","title":"Form Model","repository":"https://github.com/ui-awesome/form-model","ref":"main","commit":"eafb126cfe756b73d1743bf207b55b417ab76f41","generatedAt":"2026-11-20","url":"https://yii2-framework.github.io/docs/extensions/form-model/reference/","types":{"UIAwesome\\FormModel\\Attribute\\FieldConfig":{"kind":"class","modifiers":["final","readonly"],"url":"https://yii2-framework.github.io/docs/extensions/form-model/reference/attribute/fieldconfig/","summary":"Defines field configuration options for a form-model property.","properties":{"value":{"type":"array<string, mixed>","description":"Method names mapped to field or widget arguments.","readonly":true,"promoted":true}},"methods":{"__construct":{"signature":"public function __construct(array<string, mixed> $value)","summary":"Creates field configuration metadata.","params":[{"name":"$value","type":"array<string, mixed>","description":"Method names mapped to the argument, or list of arguments, applied to the field or to the widget that renders it."}]}}},"UIAwesome\\FormModel\\Attribute\\Hint":{"kind":"class","modifiers":["final","readonly"],"url":"https://yii2-framework.github.io/docs/extensions/form-model/reference/attribute/hint/","summary":"Defines hint text for a form-model property.","properties":{"value":{"type":"string","description":"Hint text for the field.","readonly":true,"promoted":true}},"methods":{"__construct":{"signature":"public function __construct(string $value)","summary":"Creates field hint metadata.","params":[{"name":"$value","type":"string","description":"Hint text for the field."}]}}},"UIAwesome\\FormModel\\Attribute\\Label":{"kind":"class","modifiers":["final","readonly"],"url":"https://yii2-framework.github.io/docs/extensions/form-model/reference/attribute/label/","summary":"Defines a display label for a form-model property.","properties":{"value":{"type":"string","description":"Display label for the field.","readonly":true,"promoted":true}},"methods":{"__construct":{"signature":"public function __construct(string $value)","summary":"Creates field label metadata.","params":[{"name":"$value","type":"string","description":"Display label for the field."}]}}},"UIAwesome\\FormModel\\Attribute\\Placeholder":{"kind":"class","modifiers":["final","readonly"],"url":"https://yii2-framework.github.io/docs/extensions/form-model/reference/attribute/placeholder/","summary":"Defines placeholder text for a form-model property.","properties":{"value":{"type":"string","description":"Placeholder text for the field.","readonly":true,"promoted":true}},"methods":{"__construct":{"signature":"public function __construct(string $value)","summary":"Creates field placeholder metadata.","params":[{"name":"$value","type":"string","description":"Placeholder text for the field."}]}}},"UIAwesome\\FormModel\\BaseFormModel":{"kind":"class","modifiers":["abstract"],"url":"https://yii2-framework.github.io/docs/extensions/form-model/reference/baseformmodel/","summary":"Base implementation of `UIAwesome\\FormModel\\FormModelInterface`.","extends":"UIAwesome\\Model\\BaseModel","implements":["UIAwesome\\FormModel\\FormModelInterface","UIAwesome\\Model\\ModelInterface"],"methods":{"addError":{"signature":"public function addError(string $field, string $error): void","summary":"Adds an error for a field.","params":[{"name":"$field","type":"string","description":"Field name."},{"name":"$error","type":"string","description":"Error message to append."}],"return":{"type":"void"}},"clearError":{"signature":"public function clearError(string|null $field = null): void","summary":"Clears errors for one field or all fields.","params":[{"name":"$field","type":"string|null","default":"null","optional":true,"description":"Field name, or `null` to clear all fields."}],"return":{"type":"void"}},"getError":{"signature":"public function getError(string $field): array<int, string>","summary":"Returns errors for one field.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"array<int, string>","description":"Error list for the field."}},"getErrors":{"signature":"public function getErrors(): array<string, array<int, string>>","summary":"Returns validation errors indexed by field name.","return":{"type":"array<string, array<int, string>>","description":"Errors indexed by field name. Returns an empty array when no errors exist."}},"getErrorSummary":{"signature":"public function getErrorSummary(list<string> $onlyFields = [], bool $first = false): array<int|string, string>","summary":"Returns a flattened error summary.","params":[{"name":"$onlyFields","type":"list<string>","default":"[]","optional":true,"description":"Fields to include. Uses all fields when the list is empty."},{"name":"$first","type":"bool","default":"false","optional":true,"description":"Whether to return only the first error of each field."}],"return":{"type":"array<int|string, string>","description":"Flat list of error messages when `$first` is `false`; field-indexed first errors when `$first` is `true`."}},"getFieldConfig":{"signature":"public function getFieldConfig(string $field): array<string, mixed>","summary":"Returns the field configuration for one field.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"array<string, mixed>","description":"Field configuration for the field. Returns an empty array when the field has no configuration."}},"getFieldConfigs":{"signature":"public function getFieldConfigs(): array<string, array<string, mixed>>","summary":"Returns field configuration arrays indexed by field name.","return":{"type":"array<string, array<string, mixed>>","description":"Field configuration arrays indexed by field name."}},"getFirstError":{"signature":"public function getFirstError(string $field): string","summary":"Returns the first error for one field.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"string","description":"First error for the field, or an empty string when no errors exist."}},"getFirstErrors":{"signature":"public function getFirstErrors(): array<string, string>","summary":"Returns the first validation error indexed by field name.","return":{"type":"array<string, string>","description":"First errors indexed by field name. Returns an empty array when no errors exist."}},"getHint":{"signature":"public function getHint(string $field): string","summary":"Returns the hint text for one field.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"string","description":"Hint text for the field."}},"getHints":{"signature":"public function getHints(): array<string, string>","summary":"Returns hint text indexed by field name.","return":{"type":"array<string, string>","description":"Hint text indexed by field name."}},"getLabel":{"signature":"public function getLabel(string $field): string","summary":"Returns the label text for one field.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"string","description":"Label text for the field."}},"getLabels":{"signature":"public function getLabels(): array<string, string>","summary":"Returns label text indexed by field name.","return":{"type":"array<string, string>","description":"Label text indexed by field name."}},"getPlaceholder":{"signature":"public function getPlaceholder(string $field): string","summary":"Returns the placeholder text for one field.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"string","description":"Placeholder text for the field."}},"getPlaceholders":{"signature":"public function getPlaceholders(): array<string, string>","summary":"Returns placeholder text indexed by field name.","return":{"type":"array<string, string>","description":"Placeholder text indexed by field name."}},"getRule":{"signature":"public function getRule(string $field): array<mixed, mixed>|null","summary":"Returns validation rules for one field.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"array<mixed, mixed>|null","description":"Validation rules for the field, or `null` when no rules are defined."}},"getRules":{"signature":"public function getRules(): iterable<string, array<mixed, mixed>>","summary":"Returns validation rules indexed by field name.","return":{"type":"iterable<string, array<mixed, mixed>>","description":"Validation rules indexed by field name."}},"hasError":{"signature":"public function hasError(string|null $field = null): bool","summary":"Checks whether errors exist.","params":[{"name":"$field","type":"string|null","default":"null","optional":true,"description":"Field name, or `null` to check all fields."}],"return":{"type":"bool","description":"`true` if errors exist, otherwise `false`."}},"isValidated":{"signature":"public function isValidated(string $field): bool","summary":"Checks whether a field has been validated successfully.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"bool","description":"`true` if the field exists in the error map with no messages, otherwise `false`."}},"setErrors":{"signature":"public function setErrors(array<string, array<int, string>> $values): void","summary":"Replaces all field errors.","params":[{"name":"$values","type":"array<string, array<int, string>>","description":"Error messages indexed by field name."}],"return":{"type":"void"}}},"inherited":{"methods":{"add":"UIAwesome\\Model\\BaseModel","getData":"UIAwesome\\Model\\BaseModel","getModelName":"UIAwesome\\Model\\BaseModel","getNames":"UIAwesome\\Model\\BaseModel","getTypes":"UIAwesome\\Model\\BaseModel","getValue":"UIAwesome\\Model\\BaseModel","has":"UIAwesome\\Model\\BaseModel","isEmpty":"UIAwesome\\Model\\BaseModel","isType":"UIAwesome\\Model\\BaseModel","load":"UIAwesome\\Model\\BaseModel","setValue":"UIAwesome\\Model\\BaseModel","setValues":"UIAwesome\\Model\\BaseModel","toArray":"UIAwesome\\Model\\BaseModel"}}},"UIAwesome\\FormModel\\Exception\\Message":{"kind":"enum","url":"https://yii2-framework.github.io/docs/extensions/form-model/reference/exception/message/","summary":"Represents reusable error message templates for form-model exceptions.","backingType":"string","cases":{"INVALID_NESTED_FIELD_PATH":{"value":"\"Invalid nested field path format: '%s'.\"","description":"Indicates invalid dot-notated nested field path syntax."},"UNKNOWN_METADATA_METHOD":{"value":"\"Unknown metadata method: '%s'.\"","description":"Indicates an unknown top-level metadata method."},"UNKNOWN_NESTED_METADATA_METHOD":{"value":"\"Unknown nested metadata method: '%s'.\"","description":"Indicates an unknown nested metadata method."}},"methods":{"getMessage":{"signature":"public function getMessage(int|string ...$argument): string","summary":"Returns the formatted message string for the error case.","params":[{"name":"$argument","type":"int|string","optional":true,"variadic":true,"description":"Values to insert into the message template."}],"return":{"type":"string","description":"Formatted error message with interpolated arguments."}}}},"UIAwesome\\FormModel\\FieldError":{"kind":"class","modifiers":["final"],"url":"https://yii2-framework.github.io/docs/extensions/form-model/reference/fielderror/","summary":"Stores and queries validation errors by field.","methods":{"add":{"signature":"public function add(string $field, string $error): void","summary":"Adds an error message for a field.","params":[{"name":"$field","type":"string","description":"Field name."},{"name":"$error","type":"string","description":"Error message to append."}],"return":{"type":"void"}},"clear":{"signature":"public function clear(string|null $field = null): void","summary":"Clears errors for one field or all fields.","params":[{"name":"$field","type":"string|null","default":"null","optional":true,"description":"Field name, or `null` to clear all fields."}],"return":{"type":"void"}},"get":{"signature":"public function get(bool $first = false): array<string, array<int, string>|string>","summary":"Returns validation errors indexed by field name.","params":[{"name":"$first","type":"bool","default":"false","optional":true,"description":"Whether to return only the first error for each field."}],"return":{"type":"array<string, array<int, string>|string>","description":"Errors indexed by field name. Returns an empty array when no errors exist."}},"getAll":{"signature":"public function getAll(): array<string, array<int, string>>","summary":"Returns all errors indexed by field name.","return":{"type":"array<string, array<int, string>>","description":"Non-empty errors indexed by field name."}},"getAllFirst":{"signature":"public function getAllFirst(): array<string, string>","summary":"Returns the first error for each field.","return":{"type":"array<string, string>","description":"First errors indexed by field name."}},"getField":{"signature":"public function getField(string $field, bool $first = false): array<int, string>|string","summary":"Returns errors for a single field.","params":[{"name":"$field","type":"string","description":"Field name."},{"name":"$first","type":"bool","default":"false","optional":true,"description":"Whether to return only the first error."}],"return":{"type":"array<int, string>|string","description":"Error list for the field, or the first error when `$first` is `true`."}},"getFirstForField":{"signature":"public function getFirstForField(string $field): string","summary":"Returns the first error for one field.","params":[{"name":"$field","type":"string"}],"return":{"type":"string"}},"getForField":{"signature":"public function getForField(string $field): array<int, string>","summary":"Returns all errors for one field.","params":[{"name":"$field","type":"string"}],"return":{"type":"array<int, string>","description":"Errors for the requested field."}},"getSummary":{"signature":"public function getSummary(list<string> $onlyFields = [], bool $first = false): array<int|string, string>","summary":"Returns a flattened error summary.","params":[{"name":"$onlyFields","type":"list<string>","default":"[]","optional":true,"description":"Fields to include. Uses all fields when the list is empty."},{"name":"$first","type":"bool","default":"false","optional":true,"description":"Whether to include only the first error for each field."}],"return":{"type":"array<int|string, string>","description":"Flat list of error messages."}},"has":{"signature":"public function has(string|null $field = null): bool","summary":"Checks whether errors exist.","params":[{"name":"$field","type":"string|null","default":"null","optional":true,"description":"Field name, or `null` to check all fields."}],"return":{"type":"bool","description":"`true` if errors exist, otherwise `false`."}},"isValidated":{"signature":"public function isValidated(string $field): bool","summary":"Checks whether a field has been validated successfully.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"bool","description":"`true` if the field exists in the error map with no messages, otherwise `false`."}},"set":{"signature":"public function set(array<string, array<int, string>> $values): void","summary":"Replaces the full error collection.","params":[{"name":"$values","type":"array<string, array<int, string>>","description":"Error messages indexed by field name."}],"return":{"type":"void"}}}},"UIAwesome\\FormModel\\FormModelInterface":{"kind":"interface","url":"https://yii2-framework.github.io/docs/extensions/form-model/reference/formmodelinterface/","summary":"Defines the contract for form models with validation metadata and field errors.","implements":["UIAwesome\\Model\\ModelInterface"],"methods":{"addError":{"signature":"abstract public function addError(string $field, string $error): void","summary":"Adds an error for a field.","params":[{"name":"$field","type":"string","description":"Field name."},{"name":"$error","type":"string","description":"Error message to append."}],"return":{"type":"void"},"abstract":true},"clearError":{"signature":"abstract public function clearError(string|null $field = null): void","summary":"Clears errors for one field or all fields.","params":[{"name":"$field","type":"string|null","default":"null","optional":true,"description":"Field name, or `null` to clear all fields."}],"return":{"type":"void"},"abstract":true},"getError":{"signature":"abstract public function getError(string $field): array<int, string>","summary":"Returns errors for one field.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"array<int, string>","description":"Error list for the field."},"abstract":true},"getErrors":{"signature":"abstract public function getErrors(): array<string, array<int, string>>","summary":"Returns validation errors indexed by field name.","return":{"type":"array<string, array<int, string>>","description":"Errors indexed by field name. Returns an empty array when no errors exist."},"abstract":true},"getErrorSummary":{"signature":"abstract public function getErrorSummary(list<string> $onlyFields = [], bool $first = false): array<int|string, string>","summary":"Returns a flattened error summary.","params":[{"name":"$onlyFields","type":"list<string>","default":"[]","optional":true,"description":"Fields to include. Uses all fields when the list is empty."},{"name":"$first","type":"bool","default":"false","optional":true,"description":"Whether to return only the first error of each field."}],"return":{"type":"array<int|string, string>","description":"Flat list of error messages when `$first` is `false`; field-indexed first errors when `$first` is `true`."},"abstract":true},"getFieldConfig":{"signature":"abstract public function getFieldConfig(string $field): array<string, mixed>","summary":"Returns the field configuration for one field.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"array<string, mixed>","description":"Field configuration for the field. Returns an empty array when the field has no configuration."},"abstract":true},"getFieldConfigs":{"signature":"abstract public function getFieldConfigs(): array<string, array<string, mixed>>","summary":"Returns field configuration arrays indexed by field name.","return":{"type":"array<string, array<string, mixed>>","description":"Field configuration arrays indexed by field name."},"abstract":true},"getFirstError":{"signature":"abstract public function getFirstError(string $field): string","summary":"Returns the first error for one field.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"string","description":"First error for the field, or an empty string when no errors exist."},"abstract":true},"getFirstErrors":{"signature":"abstract public function getFirstErrors(): array<string, string>","summary":"Returns the first validation error indexed by field name.","return":{"type":"array<string, string>","description":"First errors indexed by field name. Returns an empty array when no errors exist."},"abstract":true},"getHint":{"signature":"abstract public function getHint(string $field): string","summary":"Returns the hint text for one field.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"string","description":"Hint text for the field."},"abstract":true},"getHints":{"signature":"abstract public function getHints(): array<string, string>","summary":"Returns hint text indexed by field name.","return":{"type":"array<string, string>","description":"Hint text indexed by field name."},"abstract":true},"getLabel":{"signature":"abstract public function getLabel(string $field): string","summary":"Returns the label text for one field.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"string","description":"Label text for the field."},"abstract":true},"getLabels":{"signature":"abstract public function getLabels(): array<string, string>","summary":"Returns label text indexed by field name.","return":{"type":"array<string, string>","description":"Label text indexed by field name."},"abstract":true},"getPlaceholder":{"signature":"abstract public function getPlaceholder(string $field): string","summary":"Returns the placeholder text for one field.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"string","description":"Placeholder text for the field."},"abstract":true},"getPlaceholders":{"signature":"abstract public function getPlaceholders(): array<string, string>","summary":"Returns placeholder text indexed by field name.","return":{"type":"array<string, string>","description":"Placeholder text indexed by field name."},"abstract":true},"getRule":{"signature":"abstract public function getRule(string $field): array<mixed, mixed>|null","summary":"Returns validation rules for one field.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"array<mixed, mixed>|null","description":"Validation rules for the field, or `null` when no rules are defined."},"abstract":true},"getRules":{"signature":"abstract public function getRules(): iterable<string, array<mixed, mixed>>","summary":"Returns validation rules indexed by field name.","return":{"type":"iterable<string, array<mixed, mixed>>","description":"Validation rules indexed by field name."},"abstract":true},"hasError":{"signature":"abstract public function hasError(string|null $field = null): bool","summary":"Checks whether errors exist.","params":[{"name":"$field","type":"string|null","default":"null","optional":true,"description":"Field name, or `null` to check all fields."}],"return":{"type":"bool","description":"`true` if errors exist, otherwise `false`."},"abstract":true},"isValidated":{"signature":"abstract public function isValidated(string $field): bool","summary":"Checks whether a field has been validated successfully.","params":[{"name":"$field","type":"string","description":"Field name."}],"return":{"type":"bool","description":"`true` if the field exists in the error map with no messages, otherwise `false`."},"abstract":true},"setErrors":{"signature":"abstract public function setErrors(array<string, array<int, string>> $values): void","summary":"Replaces all field errors.","params":[{"name":"$values","type":"array<string, array<int, string>>","description":"Error messages indexed by field name."}],"return":{"type":"void"},"abstract":true}},"inherited":{"methods":{"add":"UIAwesome\\Model\\ModelInterface","getData":"UIAwesome\\Model\\ModelInterface","getModelName":"UIAwesome\\Model\\ModelInterface","getNames":"UIAwesome\\Model\\ModelInterface","getTypes":"UIAwesome\\Model\\ModelInterface","getValue":"UIAwesome\\Model\\ModelInterface","has":"UIAwesome\\Model\\ModelInterface","isEmpty":"UIAwesome\\Model\\ModelInterface","isType":"UIAwesome\\Model\\ModelInterface","load":"UIAwesome\\Model\\ModelInterface","setValue":"UIAwesome\\Model\\ModelInterface","setValues":"UIAwesome\\Model\\ModelInterface","toArray":"UIAwesome\\Model\\ModelInterface"}}}}}
