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

protected WidgetBase::getFieldSettings() Returns the array of field settings. Return value array The array of settings. File core/lib/Drupal/Core/Field/WidgetBase.php, line 515 Class WidgetBase Base class for 'Field widget' plugin implementations. Namespace Drupal\Core\Field Code protected function getFieldSettings() { return $this->fieldDefinition->getSettings(); }

WidgetBase::formSingleElement

protected WidgetBase::formSingleElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) Generates the form element for a single copy of the widget. File core/lib/Drupal/Core/Field/WidgetBase.php, line 313 Class WidgetBase Base class for 'Field widget' plugin implementations. Namespace Drupal\Core\Field Code protected function formSingleElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInter

WidgetBase::getFilteredDescription

protected WidgetBase::getFilteredDescription() Returns the filtered field description. Return value \Drupal\Core\Field\FieldFilteredMarkup The filtered field description, with tokens replaced. File core/lib/Drupal/Core/Field/WidgetBase.php, line 571 Class WidgetBase Base class for 'Field widget' plugin implementations. Namespace Drupal\Core\Field Code protected function getFilteredDescription() { return FieldFilteredMarkup::create(\Drupal::token()->replace($this->fieldDefiniti

WidgetBase::getFieldSetting

protected WidgetBase::getFieldSetting($setting_name) Returns the value of a field setting. Parameters string $setting_name: The setting name. Return value mixed The setting value. File core/lib/Drupal/Core/Field/WidgetBase.php, line 528 Class WidgetBase Base class for 'Field widget' plugin implementations. Namespace Drupal\Core\Field Code protected function getFieldSetting($setting_name) { return $this->fieldDefinition->getSetting($setting_name); }

WidgetBase::getWidgetState

public static WidgetBase::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 pairs: i

WidgetBase::form

public WidgetBase::form(FieldItemListInterface $items, array &$form, FormStateInterface $form_state, $get_delta = NULL) Creates a form element for a field. If the entity associated with the form is new (i.e., $entity->isNew() is TRUE), the 'default value', if any, is pre-populated. Also allows other modules to alter the form element by implementing their own hooks. Parameters \Drupal\Core\Field\FieldItemListInterface $items: An array of the field values. When creating a new entity this

WidgetBase::flagErrors

public WidgetBase::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 might be

WidgetBase::formMultipleElements

protected WidgetBase::formMultipleElements(FieldItemListInterface $items, array &$form, FormStateInterface $form_state) Special handling to create form elements for multiple values. Handles generic features for multiple fields: number of widgets AHAH-'add more' button table display and drag-n-drop value reordering File core/lib/Drupal/Core/Field/WidgetBase.php, line 142 Class WidgetBase Base class for 'Field widget' plugin implementations. Namespace Drupal\Core\Field Code protec