You are here

protected function EntityReferenceViewsOptionsButtonsWidget::getEmptyLabel in Entity Reference Views Select 8

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

Return value

string|null Either a label of the empty option, or NULL.

Overrides OptionsWidgetBase::getEmptyLabel

File

src/Plugin/Field/FieldWidget/EntityReferenceViewsOptionsButtonsWidget.php, line 125

Class

EntityReferenceViewsOptionsButtonsWidget
Plugin implementation of the 'erviews_options_buttons' widget.

Namespace

Drupal\entity_reference_views_select\Plugin\Field\FieldWidget

Code

protected function getEmptyLabel() {
  if (!$this->required && !$this->multiple) {
    return $this
      ->t('N/A');
  }
}