WidgetBaseInterface::getWidgetState

public static WidgetBaseInterface::getWidgetState(array $parents, $field_name, FormStateInterface $form_state) Retrieves processing information about the widget from $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 field lives in the form. string $field_name: The field name. \Drupal\Core\Form\FormStateInterface $form_state: The form state. Return value array An array with the following key/value

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::__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::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::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::isApplicable

public static WidgetBase::isApplicable(FieldDefinitionInterface $field_definition) Returns if the widget can be used for the provided field. Parameters \Drupal\Core\Field\FieldDefinitionInterface $field_definition: The field definition that should be checked. Return value bool TRUE if the widget can be used, FALSE otherwise. Overrides WidgetInterface::isApplicable File core/lib/Drupal/Core/Field/WidgetBase.php, line 547 Class WidgetBase Base class for 'Field widget' plugin implementation

WidgetBase::massageFormValues

public WidgetBase::massageFormValues(array $values, array $form, FormStateInterface $form_state) Massages the form values into the format expected for field values. Parameters array $values: The submitted form values produced by the widget. If the widget does not manage multiple values itself, the array holds the values generated by the multiple copies of the $element generated by the formElement() method, keyed by delta. If the widget manages multiple values, the array holds the values of the

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::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