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

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

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