You are here

protected function WidgetBase::isRequired in Select (or other) 4.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldWidget/WidgetBase.php \Drupal\select_or_other\Plugin\Field\FieldWidget\WidgetBase::isRequired()

Helper method to determine if the field is required.

Return value

bool Whether the field is required or not.

File

src/Plugin/Field/FieldWidget/WidgetBase.php, line 54

Class

WidgetBase
Base class for the 'select_or_other_*' widgets.

Namespace

Drupal\select_or_other\Plugin\Field\FieldWidget

Code

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