function WidgetBase::handlesMultipleValues

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/WidgetBase.php \Drupal\Core\Field\WidgetBase::handlesMultipleValues()
  2. 8.9.x core/lib/Drupal/Core/Field/WidgetBase.php \Drupal\Core\Field\WidgetBase::handlesMultipleValues()
  3. 10 core/lib/Drupal/Core/Field/WidgetBase.php \Drupal\Core\Field\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().

3 calls to WidgetBase::handlesMultipleValues()
WidgetBase::extractFormValues in core/lib/Drupal/Core/Field/WidgetBase.php
Extracts field values from submitted form values.
WidgetBase::flagErrors in core/lib/Drupal/Core/Field/WidgetBase.php
Reports field-level validation errors against actual form elements.
WidgetBase::form in core/lib/Drupal/Core/Field/WidgetBase.php
Creates a form element for a field.

File

core/lib/Drupal/Core/Field/WidgetBase.php, line 684

Class

WidgetBase
Base class for 'Field widget' plugin implementations.

Namespace

Drupal\Core\Field

Code

protected function handlesMultipleValues() {
    $definition = $this->getPluginDefinition();
    return $definition['multiple_values'];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.