WidgetBaseInterface::extractFormValues

public WidgetBaseInterface::extractFormValues(FieldItemListInterface $items, array $form, FormStateInterface $form_state) Extracts field values from submitted form values. Parameters \Drupal\Core\Field\FieldItemListInterface $items: The field values. This parameter is altered by reference to receive the incoming form values. array $form: The form structure where field elements are attached to. This might be a full form structure, or a sub-element of a larger form. \Drupal\Core\Form\FormStateIn

WidgetBaseInterface::flagErrors

public WidgetBaseInterface::flagErrors(FieldItemListInterface $items, ConstraintViolationListInterface $violations, array $form, FormStateInterface $form_state) Reports field-level validation errors against actual form elements. Parameters \Drupal\Core\Field\FieldItemListInterface $items: The field values. \Symfony\Component\Validator\ConstraintViolationListInterface $violations: A list of constraint violations to flag. array $form: The form structure where field elements are attached to. This

WidgetBaseInterface

Base interface definition for "Field widget" plugins. This interface details base wrapping methods that most widget implementations will want to directly inherit from Drupal\Core\Field\WidgetBase. See Drupal\Core\Field\WidgetInterface for methods that will more likely be overridden in actual widget implementations. Hierarchy interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Core\Config\Entity\ThirdPartySettingsInterfaceinterface \Drupal\Core\Field\PluginSettingsInt

WidgetBase::settingsSummary

public WidgetBase::settingsSummary() Returns a short summary for the current widget settings. If an empty result is returned, a UI can still be provided to display a settings form in case the widget has configurable settings. Return value array A short summary of the widget settings. Overrides WidgetInterface::settingsSummary File core/lib/Drupal/Core/Field/WidgetBase.php, line 491 Class WidgetBase Base class for 'Field widget' plugin implementations. Namespace Drupal\Core\Field Code

WidgetBase::__construct

public WidgetBase::__construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings) Constructs a WidgetBase object. Parameters array $plugin_id: The plugin_id for the widget. mixed $plugin_definition: The plugin implementation definition. \Drupal\Core\Field\FieldDefinitionInterface $field_definition: The definition of the field to which the widget is associated. array $settings: The widget settings. array $third_party_setting

WidgetBase::setWidgetState

public static WidgetBase::setWidgetState(array $parents, $field_name, FormStateInterface $form_state, array $field_state) Stores processing information about the widget in $form_state. This method is static so that it can be used in static Form API #callbacks. Parameters array $parents: The array of #parents where the widget lives in the form. string $field_name: The field name. \Drupal\Core\Form\FormStateInterface $form_state: The form state. array $field_state: The array of data to store. Se

WidgetBase::isDefaultValueWidget

protected WidgetBase::isDefaultValueWidget(FormStateInterface $form_state) Returns whether the widget used for default value form. Parameters \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Return value bool TRUE if a widget used to input default value, FALSE otherwise. File core/lib/Drupal/Core/Field/WidgetBase.php, line 561 Class WidgetBase Base class for 'Field widget' plugin implementations. Namespace Drupal\Core\Field Code protected function isDe

WidgetBase::getWidgetStateParents

protected static WidgetBase::getWidgetStateParents(array $parents, $field_name) Returns the location of processing information within $form_state. Parameters array $parents: The array of #parents where the widget lives in the form. string $field_name: The field name. Return value array The location of processing information within $form_state. File core/lib/Drupal/Core/Field/WidgetBase.php, line 474 Class WidgetBase Base class for 'Field widget' plugin implementations. Namespace Drupa

WidgetBase::handlesMultipleValues

protected WidgetBase::handlesMultipleValues() Returns whether the widget handles multiple values. Return value bool TRUE if a single copy of formElement() can handle multiple field values, FALSE if multiple values require separate copies of formElement(). File core/lib/Drupal/Core/Field/WidgetBase.php, line 539 Class WidgetBase Base class for 'Field widget' plugin implementations. Namespace Drupal\Core\Field Code protected function handlesMultipleValues() { $definition = $this->g

WidgetBase::settingsForm

public WidgetBase::settingsForm(array $form, FormStateInterface $form_state) Returns a form to configure settings for the widget. Invoked from \Drupal\field_ui\Form\EntityDisplayFormBase to allow administrators to configure the widget. The field_ui module takes care of handling submitted form values. Parameters array $form: The form where the settings form is being included in. \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Return value array The form definit