protected function ButtonsWidget::getEmptyOption

Returns the empty option to add to the list of options, if any.

Return value

string|null Either static::OPTIONS_EMPTY_NONE, static::OPTIONS_EMPTY_SELECT, or NULL.

Overrides OptionsWidgetBase::getEmptyOption

File

drupal/core/modules/options/lib/Drupal/options/Plugin/field/widget/ButtonsWidget.php, line 70
Contains \Drupal\options\Plugin\field\widget\ButtonsWidget.

Class

ButtonsWidget
Plugin implementation of the 'options_buttons' widget.

Namespace

Drupal\options\Plugin\field\widget

Code

protected function getEmptyOption() {
  if (!$this->required && !$this->multiple) {
    return static::OPTIONS_EMPTY_NONE;
  }
}