You are here

protected function SelectOrOtherWidgetBase::isRequired in Select (or other) 8.3

Helper method to determine if the field is required.

Return value

bool

1 call to SelectOrOtherWidgetBase::isRequired()
Widget::getEmptyOption in src/Plugin/Field/FieldWidget/Widget.php
Returns the empty option to add to the list of options, if any.

File

src/Plugin/Field/FieldWidget/SelectOrOtherWidgetBase.php, line 72
Contains \Drupal\select_or_other\Plugin\Field\FieldWidget\SelectOrOtherWidgetBase.

Class

SelectOrOtherWidgetBase
Base class for the 'select_or_other_*' widgets.

Namespace

Drupal\select_or_other\Plugin\Field\FieldWidget

Code

protected function isRequired() {
  return $this->fieldDefinition
    ->isRequired();
}