GravityKit\GravityMigrate\Schema\UniversalField
Represents a form field in a platform-agnostic format.
The canonical shape every supported plugin's field is converted to and from. What one platform keeps that this shape has no room for goes into extensions.
Since: %ver%
Source: src/Schema/UniversalField.php:18
Details
-
Kind:
class -
Namespace:
GravityKit\GravityMigrate\Schema -
Implements:
JsonSerializable
Properties
| Property | Type | Description |
|---|---|---|
$id | int | string | Unique identifier within the form. |
$type | string | Universal field type. |
$label | string | Field label. |
$description | string | Field description. |
$required | bool | Whether field is required. |
$placeholder | string | Placeholder text. |
$default_value | mixed | Default value. |
$css_class | string | CSS classes. |
$admin_label | string | Admin label. |
$page_number | int | Page number (for multi-page forms). |
$size | string | Field size (small, medium, large), or empty when the platform did not say. |
$choices | Choice[] | The options a select, radio, checkbox or product field offers. |
$inputs | Input[] | The parts of a composite field. |
$conditional_logic | UniversalConditionalLogic | null | When this field appears. |
$conditional_logic_payload | array | null | The rules in the spelling the platform that wrote them uses. |
$extensions | ExtensionData | Platform-specific extensions. |
$transformation_log | TransformationLog | null | TransformationLog tracking. |
$source_field_ids | array | Original field IDs from source (for composite tracking). |
$is_recomposed | bool | Whether this field was created by recomposition. |
Methods
| Method | Description |
|---|---|
__construct() | Constructor. |
add_source_field_id() | Adds a source field ID. |
get_id() | Gets field ID. |
set_id() | Sets field ID. |
get_type() | Gets field type. |
set_type() | Sets field type. |
get_label() | Gets field label. |
set_label() | Sets field label. |
get_description() | Gets field description. |
set_description() | Sets field description. |
is_required() | Checks if field is required. |
set_required() | Sets required status. |
get_placeholder() | Gets placeholder. |
set_placeholder() | Sets placeholder. |
get_default_value() | Gets default value. |
set_default_value() | Sets default value. |
get_css_class() | Gets CSS class. |
set_css_class() | Sets CSS class. |
get_admin_label() | Gets admin label. |
set_admin_label() | Sets admin label. |
get_page_number() | Gets page number. |
set_page_number() | Sets page number. |
get_size() | Gets field size. |
set_size() | Sets field size. |
get_choices() | The options this field offers, in the array form adapters read. |
choices() | The options this field offers. |
set_choices() | Sets the options this field offers. |
add_choice() | Adds one option. |
get_inputs() | The parts of this field, in the array form adapters read. |
inputs() | The parts of this field. |
set_inputs() | Sets the parts of this field. |
add_input() | Adds one part. |
get_conditional_logic() | When this field appears, in the array form adapters read. |
conditional_logic() | When this field appears. |
has_conditional_logic() | Whether anything governs when this field appears. |
set_conditional_logic() | Sets when this field appears. |
get_extensions() | Gets extensions. |
set_extensions() | Sets extensions. |
get_transformation_log() | Gets transformation log. |
set_transformation_log() | Sets transformation log. |
get_source_field_ids() | Gets source field IDs. |
set_source_field_ids() | Sets source field IDs. |
is_recomposed() | Checks if field was recomposed. |
set_recomposed() | Sets recomposed flag. |
from_array() | Creates from array. |
to_array() | Converts to array. |