diff --git a/src/Element/Form/FieldDefinition.php b/src/Element/Form/FieldDefinition.php index 94e12b868..1c441406a 100644 --- a/src/Element/Form/FieldDefinition.php +++ b/src/Element/Form/FieldDefinition.php @@ -144,6 +144,24 @@ public function options($value = null) return $this; } + /** + * optionsDefinition + */ + public function optionsDefinition() + { + $options = $this->options(); + + $result = []; + + foreach ($options as $key => $option) { + $definition = new FieldOptionDefinition; + $definition->useOptionConfig($option); + $result[$key] = $definition; + } + + return $result; + } + /** * matchesContext returns true if the field matches the supplied context */ diff --git a/src/Element/Form/FieldOptionDefinition.php b/src/Element/Form/FieldOptionDefinition.php index 8531e2690..065b0c67e 100644 --- a/src/Element/Form/FieldOptionDefinition.php +++ b/src/Element/Form/FieldOptionDefinition.php @@ -1,4 +1,4 @@ -disabled(false) ->comment(''); } + + /** + * useOptionConfig + */ + public function useOptionConfig(array $config): FieldOptionDefinition + { + // process option as documented + + return $this; + } }